<commit_before>module Ruboty
  module Jira
    module Actions
      class Base < Ruboty::Actions::Base
        def client
          JIRA::Client.new(
          username: username,
          password: password,
          site: site,
          context_path: context,
          auth_type: :basic,
          use_ssl: use_ssl
          )
        end

        def fetch_project(key)
          client.Project.find(key)
        rescue
          log.error('JIRA HTTPError')
          nil
        end

        def username
          ENV['JIRA_USERNAME']
        end

        def password
          ENV['<PASSWORD>']
        end

        def site
          ENV['JIRA_URL']
        end

        def context
          ENV['JIRA_CONTEXT_PATH'] || ''
        end

        def use_ssl
          ENV["JIRA_USE_SSL"] || true
        end

        def memory
          message.robot.brain.data[Ruboty::Jira::NAME_SPACE] ||= {}
        end

        def users
          memory["USERS"] ||= {}
        end

        def associate_name
          user = users[message.from_name]
          return if user.nil?
          user[:name]
        end

        def find_project(key)
          client.Project.find(key)
        rescue => e
          Ruboty.logger.error e
          nil<commit_msg>Fix return value when JIRA_USE_SSL is false<commit_after>module Ruboty
  module Jira
    module Actions
      class Base < Ruboty::Actions::Base
        def client
          JIRA::Client.new(
          username: username,
          password: password,
          site: site,
          context_path: context,
          auth_type: :basic,
          use_ssl: use_ssl
          )
        end

        def fetch_project(key)
          client.Project.find(key)
        rescue
          log.error('JIRA HTTPError')
          nil
        end

        def username
          ENV['JIRA_USERNAME']
        end

        def password
          ENV['<PASSWORD>']
        end

        def site
          ENV['JIRA_URL']
        end

        def context
          ENV['JIRA_CONTEXT_PATH'] || ''
        end

        def use_ssl
          value = ENV['JIRA_USE_SSL']
          return value unless value.nil?
          true
        end

        def memory
          message.robot.brain.data[Ruboty::Jira::NAME_SPACE] ||= {}
        end

        def users
          memory["USERS"] ||= {}
        end

        def associate_name
          user = users[message.from_name]
          return if user.nil?
          user[:name]
        end

        def find_project(key)
          client.Project.find(key)
        rescue => e
          Ruboty.logger.error e
          nil
{'fraction_non_alphanumeric': 0.0817344589409056, 'fraction_numerical': 0.0, 'mean_word_length': 1.3091231178033658, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '222103', 'n_tokens_mistral': 767, 'n_tokens_neox': 743, 'n_words': 168}