queryable_logs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 23b8ae959b8c34959d0db89adfcba5e50b38011264947b4de53f626bd4d1bb64
4
+ data.tar.gz: 1f9aeb0b1b2b5b8c40f0bb4245859ed06d72066f45abf6aac885f295cf0e6964
5
+ SHA512:
6
+ metadata.gz: 13c600df1ba652861169e0b9495dd1d98a71723d8e663a8b219a4c8ad872f04d906453e593cfc70e3b8ef7d8d927bdca53666c08fa268b0cd0637cf3736dcc41
7
+ data.tar.gz: 6cd4fb3c21e7e4e513e6df4a7aad840f34cb9512d5d79cc4d7004f83aa8896d89d66ad7ebb27dba3084e66421916c86c0e2ebbc856fd2062b84b2f3018db142a
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.4.2
7
+ before_install: gem install bundler -v 1.17.3
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at akshayt@m3india.in. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in queryable_logs.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,141 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ queryable_logs (0.1.0)
5
+ rails (>= 4)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (5.2.8.1)
11
+ actionpack (= 5.2.8.1)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (>= 0.6.1)
14
+ actionmailer (5.2.8.1)
15
+ actionpack (= 5.2.8.1)
16
+ actionview (= 5.2.8.1)
17
+ activejob (= 5.2.8.1)
18
+ mail (~> 2.5, >= 2.5.4)
19
+ rails-dom-testing (~> 2.0)
20
+ actionpack (5.2.8.1)
21
+ actionview (= 5.2.8.1)
22
+ activesupport (= 5.2.8.1)
23
+ rack (~> 2.0, >= 2.0.8)
24
+ rack-test (>= 0.6.3)
25
+ rails-dom-testing (~> 2.0)
26
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
+ actionview (5.2.8.1)
28
+ activesupport (= 5.2.8.1)
29
+ builder (~> 3.1)
30
+ erubi (~> 1.4)
31
+ rails-dom-testing (~> 2.0)
32
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
+ activejob (5.2.8.1)
34
+ activesupport (= 5.2.8.1)
35
+ globalid (>= 0.3.6)
36
+ activemodel (5.2.8.1)
37
+ activesupport (= 5.2.8.1)
38
+ activerecord (5.2.8.1)
39
+ activemodel (= 5.2.8.1)
40
+ activesupport (= 5.2.8.1)
41
+ arel (>= 9.0)
42
+ activestorage (5.2.8.1)
43
+ actionpack (= 5.2.8.1)
44
+ activerecord (= 5.2.8.1)
45
+ marcel (~> 1.0.0)
46
+ activesupport (5.2.8.1)
47
+ concurrent-ruby (~> 1.0, >= 1.0.2)
48
+ i18n (>= 0.7, < 2)
49
+ minitest (~> 5.1)
50
+ tzinfo (~> 1.1)
51
+ arel (9.0.0)
52
+ builder (3.2.4)
53
+ concurrent-ruby (1.2.2)
54
+ crass (1.0.6)
55
+ diff-lcs (1.5.0)
56
+ erubi (1.12.0)
57
+ globalid (0.4.2)
58
+ activesupport (>= 4.2.0)
59
+ i18n (1.14.1)
60
+ concurrent-ruby (~> 1.0)
61
+ loofah (2.21.1)
62
+ crass (~> 1.0.2)
63
+ nokogiri (>= 1.5.9)
64
+ mail (2.7.1)
65
+ mini_mime (>= 0.1.1)
66
+ marcel (1.0.2)
67
+ method_source (1.0.0)
68
+ mini_mime (1.1.2)
69
+ mini_portile2 (2.4.0)
70
+ minitest (5.15.0)
71
+ nio4r (2.5.9)
72
+ nokogiri (1.10.10)
73
+ mini_portile2 (~> 2.4.0)
74
+ rack (2.2.8)
75
+ rack-test (2.1.0)
76
+ rack (>= 1.3)
77
+ rails (5.2.8.1)
78
+ actioncable (= 5.2.8.1)
79
+ actionmailer (= 5.2.8.1)
80
+ actionpack (= 5.2.8.1)
81
+ actionview (= 5.2.8.1)
82
+ activejob (= 5.2.8.1)
83
+ activemodel (= 5.2.8.1)
84
+ activerecord (= 5.2.8.1)
85
+ activestorage (= 5.2.8.1)
86
+ activesupport (= 5.2.8.1)
87
+ bundler (>= 1.3.0)
88
+ railties (= 5.2.8.1)
89
+ sprockets-rails (>= 2.0.0)
90
+ rails-dom-testing (2.1.1)
91
+ activesupport (>= 5.0.0)
92
+ minitest
93
+ nokogiri (>= 1.6)
94
+ rails-html-sanitizer (1.5.0)
95
+ loofah (~> 2.19, >= 2.19.1)
96
+ railties (5.2.8.1)
97
+ actionpack (= 5.2.8.1)
98
+ activesupport (= 5.2.8.1)
99
+ method_source
100
+ rake (>= 0.8.7)
101
+ thor (>= 0.19.0, < 2.0)
102
+ rake (10.5.0)
103
+ rspec (3.12.0)
104
+ rspec-core (~> 3.12.0)
105
+ rspec-expectations (~> 3.12.0)
106
+ rspec-mocks (~> 3.12.0)
107
+ rspec-core (3.12.1)
108
+ rspec-support (~> 3.12.0)
109
+ rspec-expectations (3.12.2)
110
+ diff-lcs (>= 1.2.0, < 2.0)
111
+ rspec-support (~> 3.12.0)
112
+ rspec-mocks (3.12.3)
113
+ diff-lcs (>= 1.2.0, < 2.0)
114
+ rspec-support (~> 3.12.0)
115
+ rspec-support (3.12.0)
116
+ sprockets (3.7.2)
117
+ concurrent-ruby (~> 1.0)
118
+ rack (> 1, < 3)
119
+ sprockets-rails (3.2.2)
120
+ actionpack (>= 4.0)
121
+ activesupport (>= 4.0)
122
+ sprockets (>= 3.0.0)
123
+ thor (1.2.2)
124
+ thread_safe (0.3.6)
125
+ tzinfo (1.2.11)
126
+ thread_safe (~> 0.1)
127
+ websocket-driver (0.7.6)
128
+ websocket-extensions (>= 0.1.0)
129
+ websocket-extensions (0.1.5)
130
+
131
+ PLATFORMS
132
+ ruby
133
+
134
+ DEPENDENCIES
135
+ bundler (~> 1.17)
136
+ queryable_logs!
137
+ rake (~> 10.0)
138
+ rspec (~> 3.0)
139
+
140
+ BUNDLED WITH
141
+ 1.17.3
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Akshay Takkar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # QueryableLogs
2
+
3
+ Query your logs using good old ActiveRecord.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'queryable_logs'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install queryable_logs
20
+
21
+ Run
22
+ `rails g queryable_logs`.
23
+
24
+ This will generate a migration file and an initializer file. queryable_logs also logs the current user id. Let the gem know which method you are using to get the current user. Default is set to `current_user`.
25
+
26
+ Enter the following task to your crontab
27
+ `rake parse:logs_to_db`
28
+ eg:
29
+ `* * * * * cd /Users/akshaytakkar/sample_rails_app && /Users/akshaytakkar/.rvm/wrappers/ruby-3.1.0/rake db:parse_log_and_save_trails >> /Users/akshaytakkar/sample_rails_app/log/worker.log 2>&1`
30
+
31
+ ## Usage
32
+
33
+ Use `QueryableLogs::TrailLog` like any ActiveRecord object.
34
+ eg: query how many requests you got for the `posts` controller `index` action. `QueryableLogs::TrailLog.where(controller: 'posts', action: 'index').count`
35
+
36
+ ## License
37
+
38
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
39
+
40
+ ## Code of Conduct
41
+
42
+ Everyone interacting in the QueryableLogs project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/queryable_logs/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "queryable_logs"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,38 @@
1
+ class QueryableLogsGenerator < Rails::Generators::Base
2
+ source_root File.expand_path('../templates', __FILE__)
3
+
4
+ include Rails::Generators::Migration
5
+
6
+ source_root File.expand_path('../templates', __FILE__)
7
+
8
+ def copy_migration_file
9
+ migration_template "migration.rb", "db/migrate/create_trail_logs.rb", migration_version: migration_version
10
+ end
11
+
12
+ def copy_initializer_file
13
+ copy_file "initializer.rb", "config/initializers/trail_log.rb"
14
+ end
15
+
16
+ def copy_task_file
17
+ copy_file "task.rb", "lib/tasks/queryable_logs_parse_save.rake"
18
+ end
19
+
20
+ def rails5_and_up?
21
+ Rails::VERSION::MAJOR >= 5
22
+ end
23
+
24
+ def migration_version
25
+ if rails5_and_up?
26
+ "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
27
+ end
28
+ end
29
+
30
+ def self.next_migration_number(dirname)
31
+ if ActiveRecord::Base.timestamped_migrations
32
+ current_time = Time.now.utc
33
+ current_time.strftime("%Y%m%d%H%M%S")
34
+ else
35
+ "%.3d" % (current_numeric_version(dirname) + 1)
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,10 @@
1
+ class Trail
2
+ cattr_accessor :current_user_method, :logger, :saving_logs
3
+ LogFile = Rails.root.join('log', 'trail.log')
4
+ delegate :debug, :info, :warn, :error, :fatal, :to => :logger
5
+ end
6
+
7
+ Trail.logger = Logger.new(Trail::LogFile)
8
+ Trail.logger.level = 'info' # could be debug, info, warn, error or fatal
9
+ Trail.current_user_method = :current_user
10
+ Trail.saving_logs = false
@@ -0,0 +1,19 @@
1
+ class CreateTrailLogs < ActiveRecord::Migration<%= migration_version %>
2
+ def change
3
+ create_table :trail_logs do |t|
4
+ t.integer :user_id
5
+ t.string :ip_address
6
+ t.string :controller
7
+ t.string :action
8
+ t.string :format
9
+ t.string :http_verb
10
+ t.text :params_hash
11
+ t.datetime :logged_at
12
+ t.string :response_code
13
+ t.string :request_url
14
+ t.string :sig
15
+
16
+ t.timestamps null: false
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,6 @@
1
+ namespace :db do
2
+ desc "Parse trail log file and save to DB"
3
+ task :parse_log_and_save_trails => :environment do
4
+ QueryableLogs::TrailLog.parse_log_and_save_trails
5
+ end
6
+ end
@@ -0,0 +1,75 @@
1
+ module QueryableLogs
2
+ class TrailLog < ActiveRecord::Base
3
+ serialize :params_hash, JSON
4
+
5
+ def self.parse_log_and_save_trails(log_file_name="trail.log")
6
+ trails_recorded = []
7
+ lines = []
8
+ bytes_to_read = 0
9
+ log_file_path = "#{Rails.root}/log/#{log_file_name}"
10
+
11
+ begin
12
+ File.open(log_file_path, File::RDONLY) do |f|
13
+ f.flock(File::LOCK_SH)
14
+ bytes_to_read = File.size(log_file_path)
15
+ f.flock(File::LOCK_UN)
16
+ end
17
+ rescue
18
+ f.flock(File::LOCK_UN)
19
+ return
20
+ end
21
+
22
+ return if bytes_to_read == 0
23
+
24
+ File.open(log_file_path) do |f|
25
+ lines = f.read(bytes_to_read).split("\n")
26
+ end
27
+ lines.each do |line|
28
+ next if line.match(/\A# Logfile created on/) != nil
29
+ if m = line.match(/^I, \[(.+?)\] INFO -- : (.*)$/)
30
+ request_time_and_pid, log_line = m[1..2]
31
+ log_line = log_line.sub(/ p:(.*)$/, '')
32
+ log_params = {"p" => $1}
33
+ log_params = log_params.merge(Hash[log_line.scan(/(\w+):(\S+)/)])
34
+ app_name, visitor_id, user_id, ip_address, http_verb, url, controller, action, fmt, params_json, response_code = %w(app vid uid ip vrb url ctl act fmt p res).map { |p| log_params[p] }
35
+ request_time = Time.parse(request_time_and_pid.match(/(\S+?) (\S+?)/)[1] + " UTC").in_time_zone
36
+ params = JSON.parse(params_json || "{}")
37
+
38
+ # create trail log
39
+ TrailLog.create(sig: request_time_and_pid,
40
+ user_id: user_id,
41
+ http_verb: http_verb,
42
+ request_url: url,
43
+ ip_address: ip_address,
44
+ controller: controller,
45
+ action: action,
46
+ format: fmt,
47
+ params_hash: params,
48
+ response_code: response_code,
49
+ logged_at: request_time)
50
+ end
51
+ end
52
+
53
+ if bytes_to_read > 0
54
+ log_file_ptr = nil
55
+ begin
56
+ File.open(log_file_path, "r+") do |f|
57
+ f.flock(File::LOCK_EX)
58
+ f.seek(bytes_to_read + 1)
59
+ fsize = File.size(log_file_path)
60
+ buffer = f.read(fsize - bytes_to_read)
61
+ f.seek(0)
62
+ f.write(buffer)
63
+ f.truncate(fsize - bytes_to_read)
64
+ f.flock(File::LOCK_UN)
65
+ end
66
+ rescue Exception => e
67
+ puts "msg = #{e.message}"
68
+ puts "backtrace = #{e.backtrace}"
69
+ log_file_ptr&.flock(File::LOCK_UN)
70
+ return
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,3 @@
1
+ module QueryableLogs
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,38 @@
1
+ module QueryableLogs
2
+ module WriteLog
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ after_action :write_to_trail_log
7
+ end
8
+
9
+ def write_to_trail_log
10
+ # vid, mid, ip, vrb, url, ctl, act, fmt, res, p (must be last)
11
+ log_string = "uid:%{user_id} ip:%{ip_address} vrb:%{http_verb} url:%{url} ctl:%{controller} act:%{action} fmt:%{format} res:%{response_code} p:%{params_as_json}" % {
12
+ user_id: send(Trail.current_user_method).try(:id) || '',
13
+ ip_address: request.remote_ip,
14
+ http_verb: request.request_method,
15
+ url: Nokogiri::HTML(request.fullpath).text.strip,
16
+ controller: controller_path,
17
+ action: action_name,
18
+ format: request.format.symbol,
19
+ params_as_json: Nokogiri::HTML(params.to_json).text.strip,
20
+ response_code: response.code
21
+ }
22
+
23
+ log_file_ptr = nil
24
+ begin
25
+ File.open(JSON.parse(Trail.logger.to_json)["logdev"]["filename"], File::RDWR) do |f|
26
+ log_file_ptr = f
27
+ f.flock(File::LOCK_EX)
28
+ Trail.logger.info(log_string)
29
+ f.flock(File::LOCK_UN)
30
+ end
31
+ rescue Exception => e
32
+ puts "something went wrong ->>>>> #{e.message} #{e.backtrace}"
33
+ puts "log_string = #{log_string}"
34
+ log_file_ptr&.flock(File::LOCK_UN)
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,6 @@
1
+ require "queryable_logs/version"
2
+
3
+ module QueryableLogs
4
+ autoload :WriteLog, "queryable_logs/write_log.rb"
5
+ autoload :TrailLog, "queryable_logs/trail_log.rb"
6
+ end
@@ -0,0 +1,43 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "queryable_logs/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "queryable_logs"
8
+ spec.version = QueryableLogs::VERSION
9
+ spec.authors = ["Akshay Takkar"]
10
+ spec.email = ["akshayt@m3india.in"]
11
+
12
+ spec.summary = "Make logs queryable, just like you would query any other activerecord table"
13
+ # spec.description = ""
14
+ spec.homepage = "https://github.com/blackblood/queryable_logs"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
21
+
22
+ spec.metadata["homepage_uri"] = spec.homepage
23
+ spec.metadata["source_code_uri"] = "https://github.com/blackblood/queryable_logs"
24
+ spec.metadata["changelog_uri"] = "https://github.com/blackblood/queryable_logs/changelog"
25
+ else
26
+ raise "RubyGems 2.0 or newer is required to protect against " \
27
+ "public gem pushes."
28
+ end
29
+
30
+ # Specify which files should be added to the gem when it is released.
31
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
32
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
33
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
34
+ end
35
+ spec.bindir = "exe"
36
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
+ spec.require_paths = ["lib"]
38
+
39
+ spec.add_runtime_dependency "rails", ">= 4"
40
+ spec.add_development_dependency "bundler", "~> 1.17"
41
+ spec.add_development_dependency "rake", "~> 10.0"
42
+ spec.add_development_dependency "rspec", "~> 3.0"
43
+ end
metadata ADDED
@@ -0,0 +1,122 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: queryable_logs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Akshay Takkar
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-10-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.17'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.17'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ description:
70
+ email:
71
+ - akshayt@m3india.in
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - ".travis.yml"
79
+ - CODE_OF_CONDUCT.md
80
+ - Gemfile
81
+ - Gemfile.lock
82
+ - LICENSE.txt
83
+ - README.md
84
+ - Rakefile
85
+ - bin/console
86
+ - bin/setup
87
+ - lib/generators/queryable_logs_generator.rb
88
+ - lib/generators/templates/initializer.rb
89
+ - lib/generators/templates/migration.rb
90
+ - lib/generators/templates/task.rb
91
+ - lib/queryable_logs.rb
92
+ - lib/queryable_logs/trail_log.rb
93
+ - lib/queryable_logs/version.rb
94
+ - lib/queryable_logs/write_log.rb
95
+ - queryable_logs.gemspec
96
+ homepage: https://github.com/blackblood/queryable_logs
97
+ licenses:
98
+ - MIT
99
+ metadata:
100
+ homepage_uri: https://github.com/blackblood/queryable_logs
101
+ source_code_uri: https://github.com/blackblood/queryable_logs
102
+ changelog_uri: https://github.com/blackblood/queryable_logs/changelog
103
+ post_install_message:
104
+ rdoc_options: []
105
+ require_paths:
106
+ - lib
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ required_rubygems_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ requirements: []
118
+ rubygems_version: 3.0.4
119
+ signing_key:
120
+ specification_version: 4
121
+ summary: Make logs queryable, just like you would query any other activerecord table
122
+ test_files: []