ice_nine 0.8.0 → 0.9.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 +15 -0
- data/.rspec +5 -0
- data/.travis.yml +23 -12
- data/Gemfile +3 -65
- data/Gemfile.devtools +55 -0
- data/Rakefile +2 -6
- data/config/devtools.yml +2 -0
- data/config/flay.yml +2 -2
- data/config/flog.yml +1 -1
- data/config/mutant.yml +3 -0
- data/config/{site.reek → reek.yml} +63 -48
- data/config/rubocop.yml +62 -0
- data/config/yardstick.yml +1 -1
- data/lib/ice_nine.rb +1 -0
- data/lib/ice_nine/freezer.rb +3 -6
- data/lib/ice_nine/freezer/hash.rb +3 -2
- data/lib/ice_nine/freezer/module.rb +10 -0
- data/lib/ice_nine/support/recursion_guard.rb +5 -5
- data/lib/ice_nine/version.rb +1 -1
- data/spec/integration/ice_nine/class_methods/deep_freeze_spec.rb +16 -16
- data/spec/spec_helper.rb +18 -11
- data/spec/unit/ice_nine/class_methods/deep_freeze_spec.rb +2 -2
- data/spec/unit/ice_nine/freezer/array/class_methods/deep_freeze_spec.rb +1 -1
- data/spec/unit/ice_nine/freezer/class_methods/{element_reference_spec.rb → element_reader_spec.rb} +55 -4
- data/spec/unit/ice_nine/freezer/hash/class_methods/deep_freeze_spec.rb +12 -12
- data/spec/unit/ice_nine/freezer/module/class_methods/deep_freeze_spec.rb +24 -0
- data/spec/unit/ice_nine/freezer/no_freeze/class_methods/deep_freeze_spec.rb +1 -1
- data/spec/unit/ice_nine/freezer/object/class_methods/deep_freeze_spec.rb +1 -1
- data/spec/unit/ice_nine/freezer/range/class_methods/deep_freeze_spec.rb +2 -2
- data/spec/unit/ice_nine/freezer/struct/class_methods/deep_freeze_spec.rb +1 -1
- data/spec/unit/ice_nine/recursion_guard/class_methods/guard_spec.rb +2 -2
- metadata +16 -24
- data/spec/rcov.opts +0 -7
- data/spec/spec.opts +0 -3
- data/spec/support/heckle.rb +0 -8
- data/tasks/metrics/ci.rake +0 -9
- data/tasks/metrics/flay.rake +0 -45
- data/tasks/metrics/flog.rake +0 -44
- data/tasks/metrics/heckle.rake +0 -207
- data/tasks/metrics/metric_fu.rake +0 -31
- data/tasks/metrics/roodi.rake +0 -19
- data/tasks/metrics/yardstick.rake +0 -25
- data/tasks/spec.rake +0 -60
- data/tasks/yard.rake +0 -11
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MTFlNzA3NDRhNmQwNjNlZjc4ZjA0ZWYxMjE0ZWNlMDY3NDQ1MjNlOA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YTZiZGQzNThmNmQ1ZjZhNTRlYjBmOTI5MWM1MGVhNjE2YzhhMjIwNQ==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NjQ5YWYxMDEwYjhjMjFhNDA5MzdiMTlhNzAwNmJlMDVkNWQwNDk5MmFmYTdk
|
10
|
+
ZmNhZjM3YjQ1NjE5MjBmNjIzMWFlZmVlYjQyYTIxMmMzZDRjMDRhMGRjODVk
|
11
|
+
MWE3OTRiMjY3ZDhmMzdkYzk5Yjc3Y2Y5ODg0NWZiM2U0NWZlZTY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OGNjMWJmMjc2YTNkMWQxNWI2NGI0MTUxOTE0ZWYzYzY3YjdkMTQ4NGRjYzNm
|
14
|
+
NzgzMWNlMDAyMGI3NGUyNzRlZjkyZjkzNWVkYTMwMWJmMWFhMmU0MjUzM2Q0
|
15
|
+
OTM2YzdjYmJkYTlkYzA1Yjk1MTljMTg5OThlZWZhMzJjMzdkNjM=
|
data/.rspec
ADDED
data/.travis.yml
CHANGED
@@ -1,20 +1,31 @@
|
|
1
1
|
language: ruby
|
2
2
|
before_install: gem install bundler
|
3
|
-
bundler_args: --without yard guard
|
4
|
-
script: "bundle exec rake
|
3
|
+
bundler_args: --without yard guard benchmarks
|
4
|
+
script: "bundle exec rake ci"
|
5
5
|
rvm:
|
6
|
-
- ree
|
7
|
-
- 1.8.7
|
8
|
-
- 1.9.2
|
9
6
|
- 1.9.3
|
10
7
|
- 2.0.0
|
11
8
|
- ruby-head
|
12
|
-
-
|
13
|
-
- jruby-19mode
|
14
|
-
- jruby-head
|
15
|
-
- rbx-18mode
|
16
|
-
- rbx-19mode
|
9
|
+
# - rbx-19mode
|
17
10
|
notifications:
|
18
|
-
irc:
|
11
|
+
irc:
|
12
|
+
channels:
|
13
|
+
- irc.freenode.org#rom-rb
|
14
|
+
on_success: never
|
15
|
+
on_failure: change
|
19
16
|
email:
|
20
|
-
|
17
|
+
recipients:
|
18
|
+
- dan.kubb@gmail.com
|
19
|
+
on_success: never
|
20
|
+
on_failure: change
|
21
|
+
matrix:
|
22
|
+
include:
|
23
|
+
- rvm: jruby-19mode
|
24
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
25
|
+
- rvm: jruby-head
|
26
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
27
|
+
allow_failures:
|
28
|
+
# broken on travis
|
29
|
+
- rvm: ruby-head
|
30
|
+
# simplecov broken
|
31
|
+
- rvm: rbx-19mode
|
data/Gemfile
CHANGED
@@ -4,70 +4,8 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
group :development do
|
8
|
-
gem '
|
9
|
-
gem 'rspec', '~> 1.3.2'
|
10
|
-
gem 'yard', '~> 0.8.6.1'
|
7
|
+
group :development, :test do
|
8
|
+
gem 'devtools', git: 'https://github.com/rom-rb/devtools.git'
|
11
9
|
end
|
12
10
|
|
13
|
-
|
14
|
-
gem 'kramdown', '~> 1.0.1'
|
15
|
-
end
|
16
|
-
|
17
|
-
group :guard do
|
18
|
-
gem 'guard', '~> 1.8.0'
|
19
|
-
gem 'guard-bundler', '~> 1.0.0'
|
20
|
-
gem 'guard-rspec', '~> 1.2.1'
|
21
|
-
|
22
|
-
# file system change event handling
|
23
|
-
gem 'listen', '~> 1.2.1'
|
24
|
-
gem 'rb-fchange', '~> 0.0.6', :require => false
|
25
|
-
gem 'rb-fsevent', '~> 0.9.3', :require => false
|
26
|
-
gem 'rb-inotify', '~> 0.9.0', :require => false
|
27
|
-
|
28
|
-
# notification handling
|
29
|
-
gem 'libnotify', '~> 0.8.0', :require => false
|
30
|
-
gem 'rb-notifu', '~> 0.0.4', :require => false
|
31
|
-
gem 'terminal-notifier-guard', '~> 1.5.3', :require => false
|
32
|
-
end
|
33
|
-
|
34
|
-
group :metrics do
|
35
|
-
gem 'backports', '~> 3.3', '>= 3.3.2'
|
36
|
-
gem 'coveralls', '~> 0.6.7'
|
37
|
-
gem 'flay', '~> 1.4.3'
|
38
|
-
gem 'flog', '~> 2.5.3'
|
39
|
-
gem 'simplecov', '~> 0.7.1'
|
40
|
-
gem 'roodi', '~> 2.2.0'
|
41
|
-
gem 'yardstick', '~> 0.9.2'
|
42
|
-
|
43
|
-
platforms :ruby_19 do
|
44
|
-
gem 'yard-spellcheck', '~> 0.1.5'
|
45
|
-
end
|
46
|
-
|
47
|
-
platforms :mri_18 do
|
48
|
-
gem 'arrayfields', '~> 4.9.0' # for metric_fu
|
49
|
-
gem 'fattr', '~> 2.2.0' # for metric_fu
|
50
|
-
gem 'heckle', '~> 1.4.3'
|
51
|
-
gem 'json', '~> 1.8.0' # for metric_fu rake task
|
52
|
-
gem 'map', '~> 6.5.1' # for metric_fu
|
53
|
-
gem 'metric_fu', '~> 2.1.1'
|
54
|
-
gem 'mspec', '~> 1.5.17'
|
55
|
-
gem 'rails_best_practices', '= 1.13.3' # for metric_fu
|
56
|
-
gem 'rcov', '~> 1.0.0'
|
57
|
-
gem 'ruby2ruby', '= 1.2.2' # for heckle
|
58
|
-
end
|
59
|
-
|
60
|
-
platforms :rbx do
|
61
|
-
gem 'pelusa', '~> 0.2.2'
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
group :benchmarks do
|
66
|
-
gem 'rbench', '~> 0.2.3'
|
67
|
-
end
|
68
|
-
|
69
|
-
platform :jruby do
|
70
|
-
group :jruby do
|
71
|
-
gem 'jruby-openssl', '~> 0.8.5'
|
72
|
-
end
|
73
|
-
end
|
11
|
+
eval_gemfile 'Gemfile.devtools'
|
data/Gemfile.devtools
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
group :development do
|
4
|
+
gem 'rake', '~> 10.1.0'
|
5
|
+
gem 'rspec', '~> 2.14.1'
|
6
|
+
gem 'yard', '~> 0.8.7'
|
7
|
+
end
|
8
|
+
|
9
|
+
group :yard do
|
10
|
+
gem 'kramdown', '~> 1.1.0'
|
11
|
+
end
|
12
|
+
|
13
|
+
group :guard do
|
14
|
+
gem 'guard', '~> 1.8.1'
|
15
|
+
gem 'guard-bundler', '~> 1.0.0'
|
16
|
+
gem 'guard-rspec', '~> 3.0.2'
|
17
|
+
gem 'guard-rubocop', '~> 0.2.0'
|
18
|
+
# gem 'guard-mutant', '~> 0.0.1'
|
19
|
+
|
20
|
+
# file system change event handling
|
21
|
+
gem 'listen', '~> 1.3.0'
|
22
|
+
gem 'rb-fchange', '~> 0.0.6', require: false
|
23
|
+
gem 'rb-fsevent', '~> 0.9.3', require: false
|
24
|
+
gem 'rb-inotify', '~> 0.9.0', require: false
|
25
|
+
|
26
|
+
# notification handling
|
27
|
+
gem 'libnotify', '~> 0.8.0', require: false
|
28
|
+
gem 'rb-notifu', '~> 0.0.4', require: false
|
29
|
+
gem 'terminal-notifier-guard', '~> 1.5.3', require: false
|
30
|
+
end
|
31
|
+
|
32
|
+
group :metrics do
|
33
|
+
gem 'coveralls', '~> 0.6.7'
|
34
|
+
gem 'flay', '~> 2.4.0'
|
35
|
+
gem 'flog', '~> 4.1.1'
|
36
|
+
gem 'reek', '~> 1.3.2'
|
37
|
+
gem 'rubocop', '~> 0.11.0'
|
38
|
+
gem 'simplecov', '~> 0.7.1'
|
39
|
+
gem 'yardstick', '~> 0.9.7', git: 'https://github.com/dkubb/yardstick.git'
|
40
|
+
|
41
|
+
platforms :ruby_19, :ruby_20 do
|
42
|
+
# gem 'mutant', git: 'https://github.com/mbj/mutant.git'
|
43
|
+
gem 'yard-spellcheck', '~> 0.1.5'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
group :benchmarks do
|
48
|
+
gem 'rbench', '~> 0.2.3'
|
49
|
+
end
|
50
|
+
|
51
|
+
platform :jruby do
|
52
|
+
group :jruby do
|
53
|
+
gem 'jruby-openssl', '~> 0.8.5'
|
54
|
+
end
|
55
|
+
end
|
data/Rakefile
CHANGED
data/config/devtools.yml
ADDED
data/config/flay.yml
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
---
|
2
|
-
threshold:
|
3
|
-
total_score:
|
2
|
+
threshold: 4
|
3
|
+
total_score: 22.0
|
data/config/flog.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
---
|
2
|
-
threshold:
|
2
|
+
threshold: 8.0
|
data/config/mutant.yml
ADDED
@@ -1,91 +1,106 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
accept: []
|
4
|
-
exclude: []
|
2
|
+
Attribute:
|
5
3
|
enabled: true
|
6
|
-
reject:
|
7
|
-
- !ruby/regexp /^.$/
|
8
|
-
- !ruby/regexp /[0-9]$/
|
9
|
-
- !ruby/regexp /[A-Z]/
|
10
|
-
LargeClass:
|
11
|
-
max_methods: 1
|
12
4
|
exclude: []
|
5
|
+
BooleanParameter:
|
13
6
|
enabled: true
|
14
|
-
max_instance_variables: 1
|
15
|
-
UncommunicativeMethodName:
|
16
|
-
accept: []
|
17
7
|
exclude: []
|
8
|
+
ClassVariable:
|
18
9
|
enabled: true
|
19
|
-
reject:
|
20
|
-
- !ruby/regexp /^[a-z]$/
|
21
|
-
- !ruby/regexp /[0-9]$/
|
22
|
-
- !ruby/regexp /[A-Z]/
|
23
|
-
LongParameterList:
|
24
|
-
max_params: 1
|
25
10
|
exclude: []
|
11
|
+
ControlParameter:
|
26
12
|
enabled: true
|
27
|
-
overrides: {}
|
28
|
-
FeatureEnvy:
|
29
13
|
exclude: []
|
14
|
+
DataClump:
|
30
15
|
enabled: true
|
31
|
-
ClassVariable:
|
32
16
|
exclude: []
|
17
|
+
max_copies: 2
|
18
|
+
min_clump_size: 2
|
19
|
+
DuplicateMethodCall:
|
33
20
|
enabled: true
|
34
|
-
BooleanParameter:
|
35
21
|
exclude: []
|
22
|
+
max_calls: 1
|
23
|
+
allow_calls: []
|
24
|
+
FeatureEnvy:
|
36
25
|
enabled: true
|
26
|
+
exclude: []
|
37
27
|
IrresponsibleModule:
|
28
|
+
enabled: true
|
38
29
|
exclude: []
|
30
|
+
LongParameterList:
|
39
31
|
enabled: true
|
40
|
-
UncommunicativeModuleName:
|
41
|
-
accept: []
|
42
32
|
exclude: []
|
33
|
+
max_params: 2
|
34
|
+
overrides:
|
35
|
+
initialize:
|
36
|
+
max_params: 3
|
37
|
+
LongYieldList:
|
43
38
|
enabled: true
|
44
|
-
|
45
|
-
|
46
|
-
- !ruby/regexp /[0-9]$/
|
39
|
+
exclude: []
|
40
|
+
max_params: 2
|
47
41
|
NestedIterators:
|
42
|
+
enabled: true
|
43
|
+
exclude: []
|
44
|
+
max_allowed_nesting: 1
|
48
45
|
ignore_iterators: []
|
46
|
+
NilCheck:
|
47
|
+
enabled: true
|
49
48
|
exclude: []
|
49
|
+
RepeatedConditional:
|
50
50
|
enabled: true
|
51
|
-
max_allowed_nesting: 1
|
52
|
-
LongMethod:
|
53
|
-
max_statements: 5
|
54
51
|
exclude: []
|
52
|
+
max_ifs: 1
|
53
|
+
TooManyInstanceVariables:
|
55
54
|
enabled: true
|
56
|
-
Duplication:
|
57
|
-
allow_calls: []
|
58
55
|
exclude: []
|
56
|
+
max_instance_variables: 3
|
57
|
+
TooManyMethods:
|
59
58
|
enabled: true
|
60
|
-
max_calls: 1
|
61
|
-
UtilityFunction:
|
62
|
-
max_helper_calls: 0
|
63
59
|
exclude: []
|
60
|
+
max_methods: 10
|
61
|
+
TooManyStatements:
|
62
|
+
enabled: true
|
63
|
+
exclude:
|
64
|
+
- IceNine::Freezer::Hash#self.deep_freeze
|
65
|
+
- IceNine::Freezer::Range#self.deep_freeze
|
66
|
+
- IceNine::RecursionGuard#self.guard
|
67
|
+
- each
|
68
|
+
max_statements: 2
|
69
|
+
UncommunicativeMethodName:
|
64
70
|
enabled: true
|
65
|
-
Attribute:
|
66
71
|
exclude: []
|
67
|
-
|
68
|
-
|
72
|
+
reject:
|
73
|
+
- !ruby/regexp /^[a-z]$/
|
74
|
+
- !ruby/regexp /[0-9]$/
|
75
|
+
- !ruby/regexp /[A-Z]/
|
69
76
|
accept: []
|
77
|
+
UncommunicativeModuleName:
|
78
|
+
enabled: true
|
70
79
|
exclude: []
|
80
|
+
reject:
|
81
|
+
- !ruby/regexp /^.$/
|
82
|
+
- !ruby/regexp /[0-9]$/
|
83
|
+
accept: []
|
84
|
+
UncommunicativeParameterName:
|
71
85
|
enabled: true
|
86
|
+
exclude: []
|
72
87
|
reject:
|
73
88
|
- !ruby/regexp /^.$/
|
74
89
|
- !ruby/regexp /[0-9]$/
|
75
90
|
- !ruby/regexp /[A-Z]/
|
76
|
-
|
77
|
-
|
91
|
+
accept: []
|
92
|
+
UncommunicativeVariableName:
|
78
93
|
enabled: true
|
79
|
-
max_ifs: 1
|
80
|
-
DataClump:
|
81
94
|
exclude: []
|
95
|
+
reject:
|
96
|
+
- !ruby/regexp /^.$/
|
97
|
+
- !ruby/regexp /[0-9]$/
|
98
|
+
- !ruby/regexp /[A-Z]/
|
99
|
+
accept: []
|
100
|
+
UnusedParameters:
|
82
101
|
enabled: true
|
83
|
-
max_copies: 0
|
84
|
-
min_clump_size: 0
|
85
|
-
ControlCouple:
|
86
102
|
exclude: []
|
103
|
+
UtilityFunction:
|
87
104
|
enabled: true
|
88
|
-
LongYieldList:
|
89
|
-
max_params: 0
|
90
105
|
exclude: []
|
91
|
-
|
106
|
+
max_helper_calls: 0
|
data/config/rubocop.yml
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
AllCops:
|
2
|
+
Includes:
|
3
|
+
- '**/*.rake'
|
4
|
+
- 'Gemfile'
|
5
|
+
- 'Gemfile.devtools'
|
6
|
+
Excludes:
|
7
|
+
- '**/vendor/**'
|
8
|
+
- '**/benchmarks/**'
|
9
|
+
|
10
|
+
# Avoid parameter lists longer than five parameters.
|
11
|
+
ParameterLists:
|
12
|
+
Max: 3
|
13
|
+
CountKeywordArgs: true
|
14
|
+
|
15
|
+
# Avoid more than `Max` levels of nesting.
|
16
|
+
BlockNesting:
|
17
|
+
Max: 3
|
18
|
+
|
19
|
+
# Align with the style guide.
|
20
|
+
CollectionMethods:
|
21
|
+
PreferredMethods:
|
22
|
+
collect: 'map'
|
23
|
+
inject: 'reduce'
|
24
|
+
find: 'detect'
|
25
|
+
find_all: 'select'
|
26
|
+
|
27
|
+
# Do not force public/protected/private keyword to be indented at the same
|
28
|
+
# level as the def keyword. My personal preference is to outdent these keywords
|
29
|
+
# because I think when scanning code it makes it easier to identify the
|
30
|
+
# sections of code and visually separate them. When the keyword is at the same
|
31
|
+
# level I think it sort of blends in with the def keywords and makes it harder
|
32
|
+
# to scan the code and see where the sections are.
|
33
|
+
AccessControl:
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
# Limit line length
|
37
|
+
LineLength:
|
38
|
+
Max: 79
|
39
|
+
|
40
|
+
# Disable documentation checking until a class needs to be documented once
|
41
|
+
Documentation:
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
# Do not always use &&/|| instead of and/or.
|
45
|
+
AndOr:
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
# Do not favor modifier if/unless usage when you have a single-line body
|
49
|
+
IfUnlessModifier:
|
50
|
+
Enabled: false
|
51
|
+
|
52
|
+
# Allow case equality operator (in limited use within the specs)
|
53
|
+
CaseEquality:
|
54
|
+
Enabled: false
|
55
|
+
|
56
|
+
# Constants do not always have to use SCREAMING_SNAKE_CASE
|
57
|
+
ConstantName:
|
58
|
+
Enabled: false
|
59
|
+
|
60
|
+
# Not all trivial readers/writers can be defined with attr_* methods
|
61
|
+
TrivialAccessors:
|
62
|
+
Enabled: false
|