kungfuig 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f6ba2a2d65c5d77ce06bd93df7f1c98e97211a7
4
- data.tar.gz: b0088e41cc0db5dd9797dc05432151432a2a1e52
3
+ metadata.gz: 3ac62b08dead08d021c21acbb9c5fe2bc673d928
4
+ data.tar.gz: 47b0818b81f566d87304a257cb6f5032bcb07eb4
5
5
  SHA512:
6
- metadata.gz: 1162a74661dabaf6f796ff1ff78ee98ccf5b9bf76144c60f7ed6b81d2dc4fe4cdacce2b0190a22d6353a99381f1de33b4501560e9937bb0938dbf20ac2cae61e
7
- data.tar.gz: 53d68ae2b530834e31fbd191387c4bc625f47c193bfdb29e59c3abc69aa4a83c2b64c1fa59acc04c5518ae22f9fa225821c3327008d67d9694ede03853275c46
6
+ metadata.gz: a5816742eac7ae87672cadd8cc0fa89bca9dc88fe51feadd6ac02775c0e21b2a4fb53370a70207601d1b4c9b691ee40f3c9d79fa0bf0642f95e2d67f34428dcf
7
+ data.tar.gz: f6a24156db9d8f5e666d79cbeb397205f96030803149063a8ccd77b6436c1ff1053869ceddf261872c3b0c1c13ffe6383beae1f82831dfd797e363cd77de11bf
@@ -0,0 +1 @@
1
+ inherit_from: .rubocop_todo.yml
@@ -0,0 +1,134 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2016-03-21 14:26:06 +0100 using RuboCop version 0.37.2.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: IgnoreEmptyBlocks.
12
+ Lint/UnusedBlockArgument:
13
+ Exclude:
14
+ - 'features/step_definitions/kungfuig_steps.rb'
15
+
16
+ # Offense count: 2
17
+ Lint/UselessAssignment:
18
+ Exclude:
19
+ - 'lib/kungfuig.rb'
20
+
21
+ # Offense count: 2
22
+ Metrics/AbcSize:
23
+ Max: 26
24
+
25
+ # Offense count: 1
26
+ Metrics/CyclomaticComplexity:
27
+ Max: 7
28
+
29
+ # Offense count: 13
30
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
31
+ # URISchemes: http, https
32
+ Metrics/LineLength:
33
+ Max: 153
34
+
35
+ # Offense count: 2
36
+ # Configuration parameters: CountComments.
37
+ Metrics/MethodLength:
38
+ Max: 16
39
+
40
+ # Offense count: 1
41
+ # Cop supports --auto-correct.
42
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
43
+ # SupportedStyles: prefer_alias, prefer_alias_method
44
+ Style/Alias:
45
+ Exclude:
46
+ - 'lib/kungfuig.rb'
47
+
48
+ # Offense count: 4
49
+ # Cop supports --auto-correct.
50
+ # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods.
51
+ # SupportedStyles: line_count_based, semantic, braces_for_chaining
52
+ # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
53
+ # FunctionalMethods: let, let!, subject, watch
54
+ # IgnoredMethods: lambda, proc, it
55
+ Style/BlockDelimiters:
56
+ Exclude:
57
+ - 'features/step_definitions/kungfuig_steps.rb'
58
+ - 'lib/kungfuig.rb'
59
+
60
+ # Offense count: 1
61
+ # Cop supports --auto-correct.
62
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
63
+ # SupportedStyles: braces, no_braces, context_dependent
64
+ Style/BracesAroundHashParameters:
65
+ Exclude:
66
+ - 'features/step_definitions/kungfuig_steps.rb'
67
+
68
+ # Offense count: 3
69
+ Style/Documentation:
70
+ Exclude:
71
+ - 'spec/**/*'
72
+ - 'test/**/*'
73
+ - 'lib/kungfuig.rb'
74
+
75
+ # Offense count: 1
76
+ # Cop supports --auto-correct.
77
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
78
+ # SupportedStyles: empty_lines, no_empty_lines
79
+ Style/EmptyLinesAroundBlockBody:
80
+ Exclude:
81
+ - 'lib/kungfuig.rb'
82
+
83
+ # Offense count: 10
84
+ # Cop supports --auto-correct.
85
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
86
+ # SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline
87
+ Style/MethodDefParentheses:
88
+ Enabled: false
89
+
90
+ # Offense count: 1
91
+ Style/MultilineBlockChain:
92
+ Exclude:
93
+ - 'lib/kungfuig.rb'
94
+
95
+ # Offense count: 1
96
+ # Cop supports --auto-correct.
97
+ Style/MutableConstant:
98
+ Exclude:
99
+ - 'lib/kungfuig/version.rb'
100
+
101
+ # Offense count: 6
102
+ # Configuration parameters: SupportedStyles.
103
+ # SupportedStyles: compact, exploded
104
+ Style/RaiseArgs:
105
+ EnforcedStyle: compact
106
+
107
+ # Offense count: 6
108
+ # Cop supports --auto-correct.
109
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
110
+ # SupportedStyles: only_raise, only_fail, semantic
111
+ Style/SignalException:
112
+ Exclude:
113
+ - 'lib/kungfuig.rb'
114
+
115
+ # Offense count: 2
116
+ # Cop supports --auto-correct.
117
+ # Configuration parameters: AllowForAlignment.
118
+ Style/SpaceAroundOperators:
119
+ Exclude:
120
+ - 'features/support/env.rb'
121
+
122
+ # Offense count: 2
123
+ # Cop supports --auto-correct.
124
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
125
+ # SupportedStyles: space, no_space
126
+ Style/SpaceInsideHashLiteralBraces:
127
+ Enabled: false
128
+
129
+ # Offense count: 3
130
+ # Cop supports --auto-correct.
131
+ # Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
132
+ # SupportedStyles: single_quotes, double_quotes
133
+ Style/StringLiterals:
134
+ Enabled: false
@@ -14,9 +14,9 @@ Gem::Specification.new do |spec|
14
14
  spec.description = 'Config with goodnesses.'
15
15
  spec.homepage = 'http://kantox.com'
16
16
 
17
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(/\A(test|spec|features)\//) }
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(test|spec|features)/}) }
18
18
  spec.bindir = 'bin'
19
- spec.executables = spec.files.grep(/\Abin\//) { |f| File.basename(f) }
19
+ spec.executables = spec.files.grep(%r{\Abin/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ['lib']
21
21
 
22
22
  # spec.metadata['allowed_push_host'] = 'http://mygemserver.com' if spec.respond_to?(:metadata)
@@ -25,7 +25,7 @@ module Kungfuig
25
25
  private :options
26
26
 
27
27
  # Accepts:
28
- # option :foo, :bar: baz
28
+ # option :foo, :bar, 'baz'
29
29
  # option [:foo, 'bar', 'baz']
30
30
  # option 'foo.bar.baz'
31
31
  # option 'foo::bar::baz'
@@ -34,13 +34,11 @@ module Kungfuig
34
34
 
35
35
  MX.synchronize {
36
36
  # options.foo!.bar!.baz!
37
- build = [key, key[1..-1]].map do |candidate|
37
+ [key, key[1..-1]].map do |candidate|
38
38
  candidate.inject(options.dup) do |memo, k|
39
- memo.public_send("#{k}") unless memo.nil?
39
+ memo.public_send(k.to_s) unless memo.nil?
40
40
  end
41
- end.reduce(nil) do |memo, candidate|
42
- memo || candidate
43
- end
41
+ end.detect { |e| e }
44
42
  }
45
43
  end
46
44
 
@@ -74,7 +72,9 @@ module Kungfuig
74
72
  when Hash then hos
75
73
  when String
76
74
  begin
77
- File.exists?(hos) ? Hashie::Mash.load(hos) : Hashie::Mash.new(YAML.load(hos))
75
+ File.exist?(hos) ? Hashie::Mash.load(hos) : Hashie::Mash.new(YAML.load(hos)).tap do |opts|
76
+ fail ArgumentError.new "#{__callee__} expects valid YAML configuration file or YAML string." unless opts.is_a?(Hash)
77
+ end
78
78
  rescue ArgumentError => ae
79
79
  fail ArgumentError.new "#{__callee__} expects valid YAML configuration file. [#{hos}] contains invalid syntax."
80
80
  rescue Psych::SyntaxError => pse
@@ -1,3 +1,3 @@
1
1
  module Kungfuig
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kungfuig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kantox LTD
@@ -117,6 +117,8 @@ extra_rdoc_files: []
117
117
  files:
118
118
  - ".gitignore"
119
119
  - ".rspec"
120
+ - ".rubocop.yml"
121
+ - ".rubocop_todo.yml"
120
122
  - ".travis.yml"
121
123
  - Gemfile
122
124
  - README.md