npmdc 0.3.1 → 0.3.2
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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +6 -5
- data/lib/npmdc/config.rb +3 -1
- data/lib/npmdc/core/string_strip_heredoc.rb +9 -0
- data/lib/npmdc/railtie.rb +33 -0
- data/lib/npmdc/version.rb +1 -1
- data/lib/npmdc.rb +1 -1
- metadata +5 -4
- data/lib/npmdc/engine.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a56c417f7018f76df103bb2e55ffdf8a336a95e
|
4
|
+
data.tar.gz: 113c029da152241b908c6f6cdc19fd860871ec1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b801894de357bbcdc00431b9c83530d6b9f6087feddd1db8da84a1b0d0d03ccc4d35f66f8bc61cfbb8361882e381b5ccdd89091111e056341b47899e72adb49
|
7
|
+
data.tar.gz: a10d71f989b3ace2c97bc9babba12778e3a6e174c3424d90021cfa095d8881efa6703679438cb73f356a905d5f0aab1cd3d0890664a3ce32b6a3a310620c64f4
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -20,7 +20,7 @@ npmdc
|
|
20
20
|
Add this line to your application's Gemfile:
|
21
21
|
|
22
22
|
```ruby
|
23
|
-
gem 'npmdc'
|
23
|
+
gem 'npmdc', group: :development
|
24
24
|
```
|
25
25
|
|
26
26
|
And then execute:
|
@@ -37,10 +37,11 @@ Or install it yourself as:
|
|
37
37
|
|
38
38
|
```ruby
|
39
39
|
YourApp::Application.configure do
|
40
|
-
config.npmdc.path
|
41
|
-
config.npmdc.format
|
42
|
-
config.npmdc.color
|
43
|
-
config.npmdc.types
|
40
|
+
config.npmdc.path = "/path/to/your/frontend/code/dir" # `Rails.root` by default
|
41
|
+
config.npmdc.format = "doc" # `short`, `doc`, `progress`. `short` by default
|
42
|
+
config.npmdc.color = false # `true` by default
|
43
|
+
config.npmdc.types = ["dependencies"] # `["dependencies", "devDependencies"]` by default
|
44
|
+
config.npmdc.environments = ["development"] # `development` only by default
|
44
45
|
end
|
45
46
|
```
|
46
47
|
|
data/lib/npmdc/config.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
module Npmdc
|
2
2
|
class Config
|
3
3
|
DEPEPENDENCY_TYPES = %w(dependencies devDependencies).freeze
|
4
|
+
ENVIRONMENTS = %w(development).freeze
|
4
5
|
|
5
|
-
attr_accessor :color, :format, :output, :types
|
6
|
+
attr_accessor :color, :format, :output, :types, :environments
|
6
7
|
attr_writer :path
|
7
8
|
|
8
9
|
def initialize
|
@@ -10,6 +11,7 @@ module Npmdc
|
|
10
11
|
@format = :short
|
11
12
|
@output = STDOUT
|
12
13
|
@types = DEPEPENDENCY_TYPES
|
14
|
+
@environments = ENVIRONMENTS
|
13
15
|
end
|
14
16
|
|
15
17
|
def path
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'npmdc/core/string_strip_heredoc'
|
2
|
+
|
3
|
+
module Npmdc
|
4
|
+
class Railtie < Rails::Railtie # :nodoc:
|
5
|
+
using StringStripHeredoc
|
6
|
+
|
7
|
+
# Make config accessible through application config
|
8
|
+
config.npmdc = Npmdc.config
|
9
|
+
|
10
|
+
initializer "npmdc.initialize" do
|
11
|
+
Npmdc.config.path = Rails.root unless Npmdc.config.path?
|
12
|
+
end
|
13
|
+
|
14
|
+
initializer "npmdc.environment_check" do
|
15
|
+
unless config.npmdc.environments.include?(Rails.env)
|
16
|
+
abort <<-END.strip_heredoc
|
17
|
+
Npmdc is trying to be activated in the #{Rails.env} environment.
|
18
|
+
Probably, this is a mistake. To ensure it's only activated in development
|
19
|
+
mode, move it to the development group of your Gemfile:
|
20
|
+
gem 'npmdc', group: :development
|
21
|
+
If you still want to run it in the #{Rails.env} environment (and know
|
22
|
+
what you are doing), put this in your Rails application
|
23
|
+
configuration:
|
24
|
+
config.npmdc.environments = ['development', '#{Rails.env}']
|
25
|
+
END
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
initializer "npmdc.call" do
|
30
|
+
Npmdc.call
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/npmdc/version.rb
CHANGED
data/lib/npmdc.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: npmdc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Kashkevich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -152,13 +152,14 @@ files:
|
|
152
152
|
- lib/npmdc/checker.rb
|
153
153
|
- lib/npmdc/cli.rb
|
154
154
|
- lib/npmdc/config.rb
|
155
|
-
- lib/npmdc/
|
155
|
+
- lib/npmdc/core/string_strip_heredoc.rb
|
156
156
|
- lib/npmdc/errors.rb
|
157
157
|
- lib/npmdc/formatter.rb
|
158
158
|
- lib/npmdc/formatters/base.rb
|
159
159
|
- lib/npmdc/formatters/documentation.rb
|
160
160
|
- lib/npmdc/formatters/progress.rb
|
161
161
|
- lib/npmdc/formatters/short.rb
|
162
|
+
- lib/npmdc/railtie.rb
|
162
163
|
- lib/npmdc/version.rb
|
163
164
|
- npmdc.gemspec
|
164
165
|
homepage: https://github.com/lysyi3m/npmdc
|
@@ -181,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
182
|
version: '0'
|
182
183
|
requirements: []
|
183
184
|
rubyforge_project:
|
184
|
-
rubygems_version: 2.5
|
185
|
+
rubygems_version: 2.4.5
|
185
186
|
signing_key:
|
186
187
|
specification_version: 4
|
187
188
|
summary: Check for missed dependencies of NPM packages.
|
data/lib/npmdc/engine.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'npmdc'
|
2
|
-
|
3
|
-
module Npmdc
|
4
|
-
class Engine < Rails::Engine # :nodoc:
|
5
|
-
# Make config accessible through application config
|
6
|
-
config.npmdc = Npmdc.config
|
7
|
-
|
8
|
-
initializer "npmdc.load_hook" do |_app|
|
9
|
-
Npmdc.config.path = Rails.root unless Npmdc.config.path?
|
10
|
-
Npmdc.call
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|