i18n-instrument 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d7da75fe79894fa5290650bff9e780f626c29aa5
4
- data.tar.gz: ab491bac0af2492d1a53fe5751a11c34356a1820
2
+ SHA256:
3
+ metadata.gz: 86df6482af001815c28a8f2e516e7d8dad103c2e1d5d6f65c9934c0c7e4a24f0
4
+ data.tar.gz: 8b00220f7ff832cd6f8eabf403a50f3790a7f9b6c742e91eccf1f3811dee6ae4
5
5
  SHA512:
6
- metadata.gz: 07f38c126d01f4e2b6fca3a63c2a28c8b3d6beef4570598ee23f7b496507035a335c40843c0a70a790c8fec00abbcd0d3c443ba4bf375f30f2e4cbbc714a3a85
7
- data.tar.gz: dd79f187ccb0d536b05f191d5ec82865ad484236ff2f7b69daf0e6176205d145260efa8a67d07a83ab7aec5ec99a8d0293f11bdb808e2a141f8161dcb82dc1e2
6
+ metadata.gz: 6422141191dff8476811a8fc6f340eb2bdc9b8facc737f1387650319361dfd14378aa14a7cf99ae26101bc1719cd390de730ea13bbe063a530379d49e9f3e30c
7
+ data.tar.gz: bd35e649aa21f3ef9e6246d9adf0b03787f32d2a2c4013501567c76c5cec3d0ff4077bd1d0f9dbd8c2267fd01d6ea214ea52391cb1b83ac310e68249984a8cac
@@ -13,14 +13,9 @@ Gem::Specification.new do |s|
13
13
  s.platform = Gem::Platform::RUBY
14
14
  s.has_rdoc = true
15
15
 
16
+ s.add_dependency 'rails'
17
+ s.add_dependency 'railties'
16
18
  s.add_dependency 'i18n-debug', '~> 1.0'
17
-
18
- if ENV['RAILS_VERSION']
19
- s.add_dependency 'railties', "~> #{ENV['RAILS_VERSION']}"
20
- else
21
- s.add_dependency 'railties', '<= 5.0.7', '>= 4.0'
22
- end
23
-
24
19
  s.add_dependency 'request_store', '~> 1.0'
25
20
 
26
21
  s.require_path = 'lib'
@@ -1,5 +1,5 @@
1
1
  module I18n
2
2
  module Instrument
3
- VERSION = '1.1.0'
3
+ VERSION = '1.1.1'
4
4
  end
5
5
  end
@@ -0,0 +1,4 @@
1
+
2
+ //= link_tree ../images
3
+ //= link_directory ../javascripts .js
4
+ //= link_directory ../stylesheets .css
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,13 @@
1
+ // Action Cable provides the framework to deal with WebSockets in Rails.
2
+ // You can generate new channels where WebSocket features live using the rails generate channel command.
3
+ //
4
+ //= require action_cable
5
+ //= require_self
6
+ //= require_tree ./channels
7
+
8
+ (function() {
9
+ this.App || (this.App = {});
10
+
11
+ App.cable = ActionCable.createConsumer();
12
+
13
+ }).call(this);
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -19,9 +19,15 @@ describe I18n::Instrument::Middleware, type: :request do
19
19
  it 'records I18n.t calls in javascript' do
20
20
  params = { url: valid_url, key: valid_key, locale: 'en' }
21
21
 
22
- expect { post(config.js_endpoint, params.to_json, headers) }.to(
23
- change { recorded_params.size }.from(0).to(1)
24
- )
22
+ if Rails::VERSION::STRING < '5.0'
23
+ expect { post(config.js_endpoint, params.to_json, headers) }.to(
24
+ change { recorded_params.size }.from(0).to(1)
25
+ )
26
+ else
27
+ expect { post(config.js_endpoint, params: params.to_json, headers: headers) }.to(
28
+ change { recorded_params.size }.from(0).to(1)
29
+ )
30
+ end
25
31
 
26
32
  expect(response).to be_successful
27
33
 
@@ -36,9 +42,15 @@ describe I18n::Instrument::Middleware, type: :request do
36
42
  it "doesn't record anything when given a blank key" do
37
43
  params = { url: valid_url, key: invalid_key, locale: 'en' }
38
44
 
39
- expect { post(config.js_endpoint, params.to_json, headers) }.to_not(
40
- change { recorded_params.size }.from(0)
41
- )
45
+ if Rails::VERSION::STRING < '5.0'
46
+ expect { post(config.js_endpoint, params.to_json, headers) }.to_not(
47
+ change { recorded_params.size }.from(0)
48
+ )
49
+ else
50
+ expect { post(config.js_endpoint, params: params.to_json, headers: headers) }.to_not(
51
+ change { recorded_params.size }.from(0)
52
+ )
53
+ end
42
54
 
43
55
  expect(response).to be_successful
44
56
  end
@@ -51,9 +63,15 @@ describe I18n::Instrument::Middleware, type: :request do
51
63
  it "doesn't record any javascript I18n.t calls" do
52
64
  params = { url: valid_url, key: valid_key, locale: 'en' }
53
65
 
54
- expect { post(config.js_endpoint, params.to_json, headers) }.to_not(
55
- change { recorded_params.size }.from(0)
56
- )
66
+ if Rails::VERSION::STRING < '5.0'
67
+ expect { post(config.js_endpoint, params.to_json, headers) }.to_not(
68
+ change { recorded_params.size }.from(0)
69
+ )
70
+ else
71
+ expect { post(config.js_endpoint, params: params.to_json, headers: headers) }.to_not(
72
+ change { recorded_params.size }.from(0)
73
+ )
74
+ end
57
75
  end
58
76
  end
59
77
  end
@@ -0,0 +1,145 @@
1
+ Started POST "/i18n/instrument.json" for 127.0.0.1 at 2020-07-22 12:53:53 +0300
2
+ Started POST "/i18n/instrument.json" for 127.0.0.1 at 2020-07-22 12:53:53 +0300
3
+ Started POST "/i18n/instrument.json" for 127.0.0.1 at 2020-07-22 12:53:53 +0300
4
+ Started GET "/tests" for 127.0.0.1 at 2020-07-22 12:53:53 +0300
5
+ Processing by TestsController#index as HTML
6
+ Rendering text template
7
+ Rendered text template (0.0ms)
8
+ Completed 200 OK in 6ms (Views: 3.4ms)
9
+ Started GET "/tests" for 127.0.0.1 at 2020-07-22 12:53:54 +0300
10
+ Processing by TestsController#index as HTML
11
+ Rendering text template
12
+ Rendered text template (0.0ms)
13
+ Completed 200 OK in 1ms (Views: 0.2ms)
14
+ Started GET "/tests" for 127.0.0.1 at 2020-07-22 12:53:54 +0300
15
+ Processing by TestsController#index as HTML
16
+ Rendering text template
17
+ Rendered text template (0.0ms)
18
+ Completed 200 OK in 0ms (Views: 0.2ms)
19
+ Started GET "/tests" for 127.0.0.1 at 2020-07-22 12:53:54 +0300
20
+ Processing by TestsController#index as HTML
21
+ Completed 500 Internal Server Error in 0ms
22
+
23
+ RuntimeError (jelly beans):
24
+
25
+ app/controllers/tests_controller.rb:3:in `index'
26
+ Started GET "/tests" for 127.0.0.1 at 2020-07-22 12:53:54 +0300
27
+
28
+ RuntimeError (jelly beans):
29
+
30
+ rspec-mocks (3.9.1) lib/rspec/mocks/message_expectation.rb:143:in `block in and_raise'
31
+ rspec-mocks (3.9.1) lib/rspec/mocks/message_expectation.rb:694:in `block in call'
32
+ rspec-mocks (3.9.1) lib/rspec/mocks/message_expectation.rb:693:in `map'
33
+ rspec-mocks (3.9.1) lib/rspec/mocks/message_expectation.rb:693:in `call'
34
+ rspec-mocks (3.9.1) lib/rspec/mocks/message_expectation.rb:572:in `invoke_incrementing_actual_calls_by'
35
+ rspec-mocks (3.9.1) lib/rspec/mocks/message_expectation.rb:427:in `invoke'
36
+ rspec-mocks (3.9.1) lib/rspec/mocks/proxy.rb:201:in `message_received'
37
+ rspec-mocks (3.9.1) lib/rspec/mocks/proxy.rb:345:in `message_received'
38
+ rspec-mocks (3.9.1) lib/rspec/mocks/method_double.rb:77:in `proxy_method_invoked'
39
+ rspec-mocks (3.9.1) lib/rspec/mocks/method_double.rb:64:in `block (2 levels) in define_proxy_method'
40
+ rspec-mocks (3.9.1) lib/rspec/mocks/any_instance/recorder.rb:262:in `block in observe!'
41
+ /Users/valikos/workspace/i18n-instrument/lib/i18n/instrument/middleware.rb:52:in `call'
42
+ rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
43
+ rack (2.2.3) lib/rack/etag.rb:27:in `call'
44
+ rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'
45
+ rack (2.2.3) lib/rack/head.rb:12:in `call'
46
+ actionpack (5.2.4.3) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
47
+ rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
48
+ rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
49
+ actionpack (5.2.4.3) lib/action_dispatch/middleware/cookies.rb:670:in `call'
50
+ actionpack (5.2.4.3) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
51
+ activesupport (5.2.4.3) lib/active_support/callbacks.rb:98:in `run_callbacks'
52
+ actionpack (5.2.4.3) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
53
+ actionpack (5.2.4.3) lib/action_dispatch/middleware/executor.rb:14:in `call'
54
+ actionpack (5.2.4.3) lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
55
+ actionpack (5.2.4.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
56
+ railties (5.2.4.3) lib/rails/rack/logger.rb:38:in `call_app'
57
+ railties (5.2.4.3) lib/rails/rack/logger.rb:26:in `block in call'
58
+ activesupport (5.2.4.3) lib/active_support/tagged_logging.rb:71:in `block in tagged'
59
+ activesupport (5.2.4.3) lib/active_support/tagged_logging.rb:28:in `tagged'
60
+ activesupport (5.2.4.3) lib/active_support/tagged_logging.rb:71:in `tagged'
61
+ railties (5.2.4.3) lib/rails/rack/logger.rb:26:in `call'
62
+ actionpack (5.2.4.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
63
+ actionpack (5.2.4.3) lib/action_dispatch/middleware/request_id.rb:27:in `call'
64
+ rack (2.2.3) lib/rack/method_override.rb:24:in `call'
65
+ rack (2.2.3) lib/rack/runtime.rb:22:in `call'
66
+ activesupport (5.2.4.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
67
+ actionpack (5.2.4.3) lib/action_dispatch/middleware/executor.rb:14:in `call'
68
+ actionpack (5.2.4.3) lib/action_dispatch/middleware/static.rb:127:in `call'
69
+ rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
70
+ railties (5.2.4.3) lib/rails/engine.rb:524:in `call'
71
+ rack-test (1.1.0) lib/rack/mock_session.rb:29:in `request'
72
+ rack-test (1.1.0) lib/rack/test.rb:266:in `process_request'
73
+ rack-test (1.1.0) lib/rack/test.rb:119:in `request'
74
+ actionpack (5.2.4.3) lib/action_dispatch/testing/integration.rb:263:in `process'
75
+ actionpack (5.2.4.3) lib/action_dispatch/testing/integration.rb:18:in `get'
76
+ actionpack (5.2.4.3) lib/action_dispatch/testing/integration.rb:350:in `block (2 levels) in <module:Runner>'
77
+ ruby_middleware_spec.rb:63:in `block (3 levels) in <top (required)>'
78
+ rspec-core (3.9.2) lib/rspec/core/example.rb:257:in `instance_exec'
79
+ rspec-core (3.9.2) lib/rspec/core/example.rb:257:in `block in run'
80
+ rspec-core (3.9.2) lib/rspec/core/example.rb:503:in `block in with_around_and_singleton_context_hooks'
81
+ rspec-core (3.9.2) lib/rspec/core/example.rb:460:in `block in with_around_example_hooks'
82
+ rspec-core (3.9.2) lib/rspec/core/hooks.rb:481:in `block in run'
83
+ rspec-core (3.9.2) lib/rspec/core/hooks.rb:621:in `block in run_around_example_hooks_for'
84
+ rspec-core (3.9.2) lib/rspec/core/example.rb:345:in `call'
85
+ rspec-rails (4.0.1) lib/rspec/rails/adapters.rb:75:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
86
+ rspec-core (3.9.2) lib/rspec/core/example.rb:450:in `instance_exec'
87
+ rspec-core (3.9.2) lib/rspec/core/example.rb:450:in `instance_exec'
88
+ rspec-core (3.9.2) lib/rspec/core/hooks.rb:385:in `execute_with'
89
+ rspec-core (3.9.2) lib/rspec/core/hooks.rb:623:in `block (2 levels) in run_around_example_hooks_for'
90
+ rspec-core (3.9.2) lib/rspec/core/example.rb:345:in `call'
91
+ rspec-core (3.9.2) lib/rspec/core/hooks.rb:624:in `run_around_example_hooks_for'
92
+ rspec-core (3.9.2) lib/rspec/core/hooks.rb:481:in `run'
93
+ rspec-core (3.9.2) lib/rspec/core/example.rb:460:in `with_around_example_hooks'
94
+ rspec-core (3.9.2) lib/rspec/core/example.rb:503:in `with_around_and_singleton_context_hooks'
95
+ rspec-core (3.9.2) lib/rspec/core/example.rb:254:in `run'
96
+ rspec-core (3.9.2) lib/rspec/core/example_group.rb:644:in `block in run_examples'
97
+ rspec-core (3.9.2) lib/rspec/core/example_group.rb:640:in `map'
98
+ rspec-core (3.9.2) lib/rspec/core/example_group.rb:640:in `run_examples'
99
+ rspec-core (3.9.2) lib/rspec/core/example_group.rb:606:in `run'
100
+ rspec-core (3.9.2) lib/rspec/core/example_group.rb:607:in `block in run'
101
+ rspec-core (3.9.2) lib/rspec/core/example_group.rb:607:in `map'
102
+ rspec-core (3.9.2) lib/rspec/core/example_group.rb:607:in `run'
103
+ rspec-core (3.9.2) lib/rspec/core/runner.rb:121:in `block (3 levels) in run_specs'
104
+ rspec-core (3.9.2) lib/rspec/core/runner.rb:121:in `map'
105
+ rspec-core (3.9.2) lib/rspec/core/runner.rb:121:in `block (2 levels) in run_specs'
106
+ rspec-core (3.9.2) lib/rspec/core/configuration.rb:2058:in `with_suite_hooks'
107
+ rspec-core (3.9.2) lib/rspec/core/runner.rb:116:in `block in run_specs'
108
+ rspec-core (3.9.2) lib/rspec/core/reporter.rb:74:in `report'
109
+ rspec-core (3.9.2) lib/rspec/core/runner.rb:115:in `run_specs'
110
+ rspec-core (3.9.2) lib/rspec/core/runner.rb:89:in `run'
111
+ rspec-core (3.9.2) lib/rspec/core/runner.rb:71:in `run'
112
+ rspec-core (3.9.2) lib/rspec/core/runner.rb:45:in `invoke'
113
+ rspec-core (3.9.2) exe/rspec:4:in `<top (required)>'
114
+ /Users/valikos/.rbenv/versions/2.5.7/bin/rspec:23:in `load'
115
+ /Users/valikos/.rbenv/versions/2.5.7/bin/rspec:23:in `<top (required)>'
116
+ bundler (2.1.2) lib/bundler/cli/exec.rb:63:in `load'
117
+ bundler (2.1.2) lib/bundler/cli/exec.rb:63:in `kernel_load'
118
+ bundler (2.1.2) lib/bundler/cli/exec.rb:28:in `run'
119
+ bundler (2.1.2) lib/bundler/cli.rb:476:in `exec'
120
+ bundler (2.1.2) lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
121
+ bundler (2.1.2) lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
122
+ bundler (2.1.2) lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
123
+ bundler (2.1.2) lib/bundler/cli.rb:30:in `dispatch'
124
+ bundler (2.1.2) lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
125
+ bundler (2.1.2) lib/bundler/cli.rb:24:in `start'
126
+ bundler (2.1.2) exe/bundle:46:in `block in <top (required)>'
127
+ bundler (2.1.2) lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
128
+ bundler (2.1.2) exe/bundle:34:in `<top (required)>'
129
+ /Users/valikos/.rbenv/versions/2.5.7/bin/bundle:23:in `load'
130
+ /Users/valikos/.rbenv/versions/2.5.7/bin/bundle:23:in `<main>'
131
+ Started GET "/tests" for 127.0.0.1 at 2020-07-22 12:53:54 +0300
132
+ Processing by TestsController#index as HTML
133
+ Rendering text template
134
+ Rendered text template (0.0ms)
135
+ Completed 200 OK in 1ms (Views: 0.3ms)
136
+ Started GET "/tests" for 127.0.0.1 at 2020-07-22 12:53:54 +0300
137
+ Processing by TestsController#index as HTML
138
+ Rendering text template
139
+ Rendered text template (0.0ms)
140
+ Completed 200 OK in 1ms (Views: 0.2ms)
141
+ Started GET "/tests" for 127.0.0.1 at 2020-07-22 12:53:54 +0300
142
+ Processing by TestsController#index as HTML
143
+ Rendering text template
144
+ Rendered text template (0.0ms)
145
+ Completed 200 OK in 0ms (Views: 0.2ms)
metadata CHANGED
@@ -1,49 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n-instrument
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-08 00:00:00.000000000 Z
11
+ date: 2020-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: i18n-debug
14
+ name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: railties
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "<="
32
- - !ruby/object:Gem::Version
33
- version: 5.0.7
34
31
  - - ">="
35
32
  - !ruby/object:Gem::Version
36
- version: '4.0'
33
+ version: '0'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
- - - "<="
42
- - !ruby/object:Gem::Version
43
- version: 5.0.7
44
38
  - - ">="
45
39
  - !ruby/object:Gem::Version
46
- version: '4.0'
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: i18n-debug
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: request_store
49
57
  requirement: !ruby/object:Gem::Requirement
@@ -75,12 +83,17 @@ files:
75
83
  - lib/i18n/instrument/railtie.rb
76
84
  - lib/i18n/instrument/version.rb
77
85
  - spec/Rakefile
86
+ - spec/app/assets/config/manifest.js
87
+ - spec/app/assets/javascripts/application.js
88
+ - spec/app/assets/javascripts/cable.js
89
+ - spec/app/assets/stylesheets/application.css
78
90
  - spec/app/controllers/tests_controller.rb
79
91
  - spec/config/application.rb
80
92
  - spec/config/initializers/i18n_instrument.rb
81
93
  - spec/config/initializers/secret_token.rb
82
94
  - spec/config/routes.rb
83
95
  - spec/javascript_middleware_spec.rb
96
+ - spec/log/test.log
84
97
  - spec/ruby_middleware_spec.rb
85
98
  - spec/spec_helper.rb
86
99
  homepage: https://github.com/lumoslabs/i18n-instrument
@@ -101,8 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
114
  - !ruby/object:Gem::Version
102
115
  version: '0'
103
116
  requirements: []
104
- rubyforge_project:
105
- rubygems_version: 2.5.2
117
+ rubygems_version: 3.1.2
106
118
  signing_key:
107
119
  specification_version: 4
108
120
  summary: Instrument calls to I18n.t in Ruby and JavaScript.