macmillan-utils 1.0.27 → 1.0.29

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: b703afeccf56e22b3f681671bb722878c25d376f
4
- data.tar.gz: d39c938dc927bfc8d5a00b80245b9943e68d7806
3
+ metadata.gz: a52b592a6dc2fa6a8e43dab0d7bdcb0a124faec2
4
+ data.tar.gz: d69410c60657a9a6926737cf947a3f9dee7ffcfe
5
5
  SHA512:
6
- metadata.gz: 80725cfc5166a1324e513fa5b075fb91571f9531703a2c528c594fcd3f46e6993e410017eaece527c98d9fc88a40bc562df6fbed252ebbb6e18116b1f1dc648e
7
- data.tar.gz: 388e50726a9d51363978d391a4162bfd58d631589f6dbef3a6c8116fb57644e96ea2b7190cacdc17693739e37966d40fa3b02d986d7fe41ee6b17e2b11c4c508
6
+ metadata.gz: 8af1e77116a173bc52941b007216f674848039649e48e3d738f2a86c78b33638065aa7890c35bb10d2102e3347a2720fb557625149acb05457805bc340a9451a
7
+ data.tar.gz: bbc21e028c0be122c1edbd0aa6269bea942e425818ad2c340bd01c84935d13531e39cf590877aa06f6096b5af4326aa30f7a1354a4f895389469c073a44ac57b
data/.hound.yml CHANGED
@@ -1,39 +1,3 @@
1
- Metrics/LineLength:
2
- Description: 'Limit lines to 120 characters.'
3
- Max: 120
1
+ ruby:
2
+ config_file: .rubocop.yml
4
3
 
5
- Style/Documentation:
6
- Enabled: false
7
-
8
- Style/SpaceBeforeFirstArg:
9
- Enabled: false
10
-
11
- Style/BracesAroundHashParameters:
12
- Enabled: false
13
-
14
- Style/IndentHash:
15
- EnforcedStyle: consistent
16
-
17
- Style/AlignHash:
18
- EnforcedHashRocketStyle: table
19
- EnforcedColonStyle: table
20
-
21
- Style/AlignParameters:
22
- EnforcedStyle: with_fixed_indentation
23
-
24
- Style/StringLiterals:
25
- EnforcedStyle: single_quotes
26
-
27
- Style/CollectionMethods:
28
- PreferredMethods:
29
- collect: 'map'
30
- collect!: 'map!'
31
- inject: 'reduce'
32
- detect: 'find'
33
- find_all: 'select'
34
-
35
- Style/DotPosition:
36
- EnforcedStyle: leading
37
-
38
- Style/DoubleNegation:
39
- Enabled: false
data/.rubocop.yml CHANGED
@@ -15,6 +15,8 @@ Style/IndentHash:
15
15
  EnforcedStyle: consistent
16
16
 
17
17
  Style/AlignHash:
18
+ Severity: fatal
19
+ Enabled: true
18
20
  EnforcedHashRocketStyle: table
19
21
  EnforcedColonStyle: table
20
22
 
@@ -37,3 +39,9 @@ Style/DotPosition:
37
39
 
38
40
  Style/DoubleNegation:
39
41
  Enabled: false
42
+
43
+ Style/SpaceAroundOperators:
44
+ # When true, allows most uses of extra spacing if the intent is to align
45
+ # with an operator on the previous or next line, not counting empty lines
46
+ # or comment lines.
47
+ AllowForAlignment: true
data/.travis.yml CHANGED
@@ -3,12 +3,12 @@ sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
- - 1.9.3
7
6
  - 2.0
8
7
  - 2.1
9
8
  - 2.2
10
9
  - 2.3.0
11
- - jruby-19mode
10
+ - 2.3.1
11
+ - jruby
12
12
  - rbx-2
13
13
 
14
14
  # Ensure we don't build for *every* commit (doesn't apply to PR builds)
@@ -1,35 +1,17 @@
1
- def check_rubocop_and_hound
1
+ def check_config_file(filename)
2
2
  # ASSUMPTION: We are running the RSpec suite from the root of a project tree
3
- update_rubocop = true
4
- rubocop_file = '.rubocop.yml'
5
- local_rubocop_file = File.join(Dir.getwd, rubocop_file)
6
- local_hound_file = File.join(Dir.getwd, '.hound.yml')
3
+ update_config = true
4
+ local_config_file = File.join(Dir.getwd, filename)
7
5
 
8
- if File.exist?(local_rubocop_file)
9
- latest_rubocop_conf = File.read(File.expand_path("../../../../../#{rubocop_file}", __FILE__))
10
- current_rubocop_conf = File.read(local_rubocop_file)
11
- update_rubocop = false if current_rubocop_conf == latest_rubocop_conf
6
+ if File.exist?(local_config_file)
7
+ latest_conf = File.read(File.expand_path("../../../../../#{filename}", __FILE__))
8
+ current_conf = File.read(local_config_file)
9
+ update_config = false if current_conf == latest_conf
12
10
  end
13
11
 
14
- if !File.exist?(local_hound_file) || !File.symlink?(local_hound_file)
15
- system "rm -f #{local_hound_file}"
16
- system "ln -s #{rubocop_file} #{local_hound_file}"
17
- end
18
-
19
- if update_rubocop
20
- puts 'WARNING: You do not have the latest set of rubocop style preferences.'
21
- puts ' These have now been updated for you. :)'
22
- puts ''
23
- puts ' You can run RSpec again now.'
24
- puts ''
25
- puts " Don't forget to commit the '.rubocop.yml' and '.hound.yml' files to git!"
26
-
27
- File.open(local_rubocop_file, 'w') do |file|
28
- file.print latest_rubocop_conf
29
- end
12
+ File.open(local_config_file, 'w') { |file| file.print(latest_conf) } if update_config
30
13
 
31
- raise '...'
32
- end
14
+ update_config
33
15
  end
34
16
 
35
17
  RSpec.configure do |config|
@@ -39,6 +21,18 @@ RSpec.configure do |config|
39
21
  config.fail_fast = true if ENV['FAIL_FAST']
40
22
 
41
23
  config.before(:suite) do
42
- check_rubocop_and_hound
24
+ config_files = %w(.rubocop.yml)
25
+ config_files << '.hound.yml' if ENV['MANAGE_HOUND']
26
+ config_updated = config_files.map { |file| check_config_file(file) }.any?
27
+
28
+ if config_updated
29
+ puts 'WARNING: You do not have the latest set of Macmillan::Utils config files.'
30
+ puts ' These have now been updated for you. :)'
31
+ puts ''
32
+ puts ' You can run RSpec again now.'
33
+ puts ''
34
+ puts " Don't forget to commit the config files (#{config_files.join(', ')}) to git!"
35
+ raise '...'
36
+ end
43
37
  end
44
38
  end
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.add_development_dependency 'yard'
21
21
  spec.add_development_dependency 'pry'
22
22
  spec.add_development_dependency 'rack-test'
23
+ spec.add_development_dependency 'rack', '< 2.0.0'
23
24
 
24
25
  spec.add_dependency 'rspec'
25
26
  spec.add_dependency 'simplecov'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: macmillan-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.27
4
+ version: 1.0.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Springer Nature
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-16 00:00:00.000000000 Z
11
+ date: 2016-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rack
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "<"
88
+ - !ruby/object:Gem::Version
89
+ version: 2.0.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "<"
95
+ - !ruby/object:Gem::Version
96
+ version: 2.0.0
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rspec
85
99
  requirement: !ruby/object:Gem::Requirement