gris 0.6.1 → 0.6.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/.rubocop_todo.yml +18 -17
- data/Gemfile.lock +39 -40
- data/lib/gris/generators/migration_generator.rb +6 -3
- data/lib/gris/seed_loader.rb +1 -1
- data/lib/gris/setup.rb +3 -6
- data/lib/gris/version.rb +2 -2
- data/spec/grape_extensions/date_time_helpers_spec.rb +2 -2
- data/spec/middleware/error_handlers_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 856630d5692cc3340a555bebbe4710d6115ede9b
|
|
4
|
+
data.tar.gz: e30ca36ebce460232943fa01187195627bb93f9b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 693ba3926c61836f446780e0f8da2c21e247625b5bf69b9554ead0f4533147329e69023b09f2d5229294606d0180a56579eaa4a97a50a8a08c40118f703916a0
|
|
7
|
+
data.tar.gz: dff76d5bdb46650b9b54f77d77c75c3ca0ae7ec487787c28637ab9de7be044b04bed683777e64ce2513fe130d024dfd0f8ee1d608de254b39d01fd124ec2731b
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2016-
|
|
3
|
+
# on 2016-03-02 19:30:50 -0500 using RuboCop version 0.37.2.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
@@ -9,45 +9,42 @@
|
|
|
9
9
|
# Offense count: 3
|
|
10
10
|
# Cop supports --auto-correct.
|
|
11
11
|
# Configuration parameters: AlignWith, SupportedStyles, AutoCorrect.
|
|
12
|
+
# SupportedStyles: keyword, variable, start_of_line
|
|
12
13
|
Lint/EndAlignment:
|
|
13
14
|
Enabled: false
|
|
14
15
|
|
|
15
|
-
# Offense count:
|
|
16
|
-
Lint/NestedMethodDefinition:
|
|
17
|
-
Exclude:
|
|
18
|
-
- 'lib/gris/output_formatters/paginated_presenter.rb'
|
|
19
|
-
|
|
20
|
-
# Offense count: 5
|
|
16
|
+
# Offense count: 4
|
|
21
17
|
Metrics/AbcSize:
|
|
22
|
-
Max:
|
|
18
|
+
Max: 37
|
|
23
19
|
|
|
24
20
|
# Offense count: 1
|
|
25
21
|
# Configuration parameters: CountComments.
|
|
26
22
|
Metrics/ClassLength:
|
|
27
|
-
Max:
|
|
23
|
+
Max: 115
|
|
28
24
|
|
|
29
25
|
# Offense count: 3
|
|
30
26
|
Metrics/CyclomaticComplexity:
|
|
31
27
|
Max: 11
|
|
32
28
|
|
|
33
29
|
# Offense count: 81
|
|
34
|
-
# Configuration parameters: AllowURI, URISchemes.
|
|
30
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
|
|
31
|
+
# URISchemes: http, https
|
|
35
32
|
Metrics/LineLength:
|
|
36
33
|
Max: 159
|
|
37
34
|
|
|
38
|
-
# Offense count:
|
|
35
|
+
# Offense count: 12
|
|
39
36
|
# Configuration parameters: CountComments.
|
|
40
37
|
Metrics/MethodLength:
|
|
41
38
|
Max: 32
|
|
42
39
|
|
|
43
40
|
# Offense count: 16
|
|
44
41
|
# Cop supports --auto-correct.
|
|
45
|
-
# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep.
|
|
42
|
+
# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep, IndentationWidth.
|
|
43
|
+
# SupportedStyles: case, end
|
|
46
44
|
Style/CaseIndentation:
|
|
47
45
|
Enabled: false
|
|
48
46
|
|
|
49
|
-
# Offense count:
|
|
50
|
-
# Configuration parameters: Exclude.
|
|
47
|
+
# Offense count: 21
|
|
51
48
|
Style/Documentation:
|
|
52
49
|
Enabled: false
|
|
53
50
|
|
|
@@ -58,14 +55,17 @@ Style/DoubleNegation:
|
|
|
58
55
|
- 'lib/gris/output_formatters/presenter_link_helpers.rb'
|
|
59
56
|
|
|
60
57
|
# Offense count: 2
|
|
61
|
-
# Configuration parameters: NamePrefix, NamePrefixBlacklist.
|
|
58
|
+
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
|
|
59
|
+
# NamePrefix: is_, has_, have_
|
|
60
|
+
# NamePrefixBlacklist: is_, has_, have_
|
|
61
|
+
# NameWhitelist: is_a?
|
|
62
62
|
Style/PredicateName:
|
|
63
63
|
Exclude:
|
|
64
64
|
- 'lib/gris/generators/migration_generator.rb'
|
|
65
65
|
|
|
66
|
-
# Offense count:
|
|
66
|
+
# Offense count: 2
|
|
67
67
|
# Cop supports --auto-correct.
|
|
68
|
-
# Configuration parameters:
|
|
68
|
+
# Configuration parameters: AllowForAlignment.
|
|
69
69
|
Style/SpaceAroundOperators:
|
|
70
70
|
Exclude:
|
|
71
71
|
- 'gris.gemspec'
|
|
@@ -73,6 +73,7 @@ Style/SpaceAroundOperators:
|
|
|
73
73
|
# Offense count: 2
|
|
74
74
|
# Cop supports --auto-correct.
|
|
75
75
|
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, Whitelist.
|
|
76
|
+
# Whitelist: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym
|
|
76
77
|
Style/TrivialAccessors:
|
|
77
78
|
Exclude:
|
|
78
79
|
- 'lib/gris/generators/migration_generator.rb'
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
gris (0.6.
|
|
4
|
+
gris (0.6.2)
|
|
5
5
|
activesupport (~> 4.2, >= 4.2.0)
|
|
6
6
|
chronic (~> 0.10.0)
|
|
7
7
|
dalli (~> 2.7)
|
|
@@ -20,14 +20,14 @@ PATH
|
|
|
20
20
|
GEM
|
|
21
21
|
remote: https://rubygems.org/
|
|
22
22
|
specs:
|
|
23
|
-
activemodel (4.2.
|
|
24
|
-
activesupport (= 4.2.
|
|
23
|
+
activemodel (4.2.5.2)
|
|
24
|
+
activesupport (= 4.2.5.2)
|
|
25
25
|
builder (~> 3.1)
|
|
26
|
-
activerecord (4.2.
|
|
27
|
-
activemodel (= 4.2.
|
|
28
|
-
activesupport (= 4.2.
|
|
26
|
+
activerecord (4.2.5.2)
|
|
27
|
+
activemodel (= 4.2.5.2)
|
|
28
|
+
activesupport (= 4.2.5.2)
|
|
29
29
|
arel (~> 6.0)
|
|
30
|
-
activesupport (4.2.
|
|
30
|
+
activesupport (4.2.5.2)
|
|
31
31
|
i18n (~> 0.7)
|
|
32
32
|
json (~> 1.7, >= 1.7.7)
|
|
33
33
|
minitest (~> 5.1)
|
|
@@ -37,27 +37,25 @@ GEM
|
|
|
37
37
|
activerecord
|
|
38
38
|
sqlite3
|
|
39
39
|
arel (6.0.3)
|
|
40
|
-
ast (2.
|
|
41
|
-
astrolabe (1.3.1)
|
|
42
|
-
parser (~> 2.2)
|
|
40
|
+
ast (2.2.0)
|
|
43
41
|
axiom-types (0.1.1)
|
|
44
42
|
descendants_tracker (~> 0.0.4)
|
|
45
43
|
ice_nine (~> 0.11.0)
|
|
46
44
|
thread_safe (~> 0.3, >= 0.3.1)
|
|
47
45
|
builder (3.2.2)
|
|
48
|
-
byebug (
|
|
49
|
-
childprocess (0.5.
|
|
46
|
+
byebug (8.2.2)
|
|
47
|
+
childprocess (0.5.9)
|
|
50
48
|
ffi (~> 1.0, >= 1.0.11)
|
|
51
49
|
chronic (0.10.2)
|
|
52
50
|
coercible (1.0.0)
|
|
53
51
|
descendants_tracker (~> 0.0.1)
|
|
54
52
|
colorize (0.7.7)
|
|
55
|
-
dalli (2.7.
|
|
53
|
+
dalli (2.7.6)
|
|
56
54
|
descendants_tracker (0.0.4)
|
|
57
55
|
thread_safe (~> 0.3, >= 0.3.1)
|
|
58
56
|
diff-lcs (1.2.5)
|
|
59
57
|
equalizer (0.0.11)
|
|
60
|
-
fakefs (0.
|
|
58
|
+
fakefs (0.8.0)
|
|
61
59
|
faraday (0.9.2)
|
|
62
60
|
multipart-post (>= 1.2, < 3)
|
|
63
61
|
faraday-digestauth (0.2.1)
|
|
@@ -67,12 +65,12 @@ GEM
|
|
|
67
65
|
faraday_middleware (>= 0.9, < 0.10)
|
|
68
66
|
faraday_middleware (0.9.2)
|
|
69
67
|
faraday (>= 0.7.4, < 0.10)
|
|
70
|
-
fasterer (0.
|
|
68
|
+
fasterer (0.3.2)
|
|
71
69
|
colorize (~> 0.7)
|
|
72
|
-
ruby_parser (~> 3.
|
|
70
|
+
ruby_parser (~> 3.7)
|
|
73
71
|
ffi (1.9.10)
|
|
74
72
|
futuroscope (0.1.11)
|
|
75
|
-
git (1.
|
|
73
|
+
git (1.3.0)
|
|
76
74
|
grape (0.14.0)
|
|
77
75
|
activesupport
|
|
78
76
|
builder
|
|
@@ -104,7 +102,7 @@ GEM
|
|
|
104
102
|
net-http-digest_auth
|
|
105
103
|
uri_template
|
|
106
104
|
i18n (0.7.0)
|
|
107
|
-
ice_nine (0.11.
|
|
105
|
+
ice_nine (0.11.2)
|
|
108
106
|
indefinite_article (0.2.4)
|
|
109
107
|
activesupport
|
|
110
108
|
json (1.8.3)
|
|
@@ -112,13 +110,13 @@ GEM
|
|
|
112
110
|
logging (2.0.0)
|
|
113
111
|
little-plugger (~> 1.1)
|
|
114
112
|
multi_json (~> 1.10)
|
|
115
|
-
minitest (5.8.
|
|
113
|
+
minitest (5.8.4)
|
|
116
114
|
multi_json (1.11.2)
|
|
117
115
|
multi_xml (0.5.5)
|
|
118
116
|
multipart-post (2.0.0)
|
|
119
117
|
net-http-digest_auth (1.4)
|
|
120
|
-
parser (2.
|
|
121
|
-
ast (
|
|
118
|
+
parser (2.3.0.6)
|
|
119
|
+
ast (~> 2.2)
|
|
122
120
|
powerpack (0.1.1)
|
|
123
121
|
rack (1.6.4)
|
|
124
122
|
rack-accept (0.4.5)
|
|
@@ -130,41 +128,42 @@ GEM
|
|
|
130
128
|
racksh (1.0.0)
|
|
131
129
|
rack (>= 1.0)
|
|
132
130
|
rack-test (>= 0.5)
|
|
133
|
-
rainbow (2.
|
|
131
|
+
rainbow (2.1.0)
|
|
134
132
|
rake (10.5.0)
|
|
135
133
|
representable (2.3.0)
|
|
136
134
|
uber (~> 0.0.7)
|
|
137
135
|
roar (1.0.4)
|
|
138
136
|
representable (>= 2.0.1, < 2.4.0)
|
|
139
|
-
rspec (3.
|
|
140
|
-
rspec-core (~> 3.
|
|
141
|
-
rspec-expectations (~> 3.
|
|
142
|
-
rspec-mocks (~> 3.
|
|
143
|
-
rspec-core (3.3
|
|
144
|
-
rspec-support (~> 3.
|
|
145
|
-
rspec-expectations (3.
|
|
137
|
+
rspec (3.4.0)
|
|
138
|
+
rspec-core (~> 3.4.0)
|
|
139
|
+
rspec-expectations (~> 3.4.0)
|
|
140
|
+
rspec-mocks (~> 3.4.0)
|
|
141
|
+
rspec-core (3.4.3)
|
|
142
|
+
rspec-support (~> 3.4.0)
|
|
143
|
+
rspec-expectations (3.4.0)
|
|
146
144
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
147
|
-
rspec-support (~> 3.
|
|
148
|
-
rspec-mocks (3.
|
|
145
|
+
rspec-support (~> 3.4.0)
|
|
146
|
+
rspec-mocks (3.4.1)
|
|
149
147
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
150
|
-
rspec-support (~> 3.
|
|
151
|
-
rspec-support (3.
|
|
152
|
-
rubocop (0.
|
|
153
|
-
|
|
154
|
-
parser (>= 2.2.2.5, < 3.0)
|
|
148
|
+
rspec-support (~> 3.4.0)
|
|
149
|
+
rspec-support (3.4.1)
|
|
150
|
+
rubocop (0.37.2)
|
|
151
|
+
parser (>= 2.3.0.4, < 3.0)
|
|
155
152
|
powerpack (~> 0.1)
|
|
156
153
|
rainbow (>= 1.99.1, < 3.0)
|
|
157
|
-
ruby-progressbar (~> 1.
|
|
154
|
+
ruby-progressbar (~> 1.7)
|
|
155
|
+
unicode-display_width (~> 0.3)
|
|
158
156
|
ruby-progressbar (1.7.5)
|
|
159
|
-
ruby_parser (3.
|
|
157
|
+
ruby_parser (3.8.1)
|
|
160
158
|
sexp_processor (~> 4.1)
|
|
161
|
-
sexp_processor (4.
|
|
162
|
-
sqlite3 (1.3.
|
|
159
|
+
sexp_processor (4.7.0)
|
|
160
|
+
sqlite3 (1.3.11)
|
|
163
161
|
thor (0.19.1)
|
|
164
162
|
thread_safe (0.3.5)
|
|
165
163
|
tzinfo (1.2.2)
|
|
166
164
|
thread_safe (~> 0.1)
|
|
167
165
|
uber (0.0.15)
|
|
166
|
+
unicode-display_width (0.3.1)
|
|
168
167
|
uri_template (0.7.0)
|
|
169
168
|
virtus (1.0.5)
|
|
170
169
|
axiom-types (~> 0.1)
|
|
@@ -81,8 +81,8 @@ module Gris
|
|
|
81
81
|
# directly ported from
|
|
82
82
|
# https://github.com/rails/rails/blob/76883f92374c6395f13c16628e1d87d40b6d2399/railties/lib/rails/generators/generated_attribute.rb
|
|
83
83
|
class GeneratedAttribute # :nodoc:
|
|
84
|
-
INDEX_OPTIONS = %w(index uniq)
|
|
85
|
-
UNIQ_INDEX_OPTIONS = %w(uniq)
|
|
84
|
+
INDEX_OPTIONS = %w(index uniq).freeze
|
|
85
|
+
UNIQ_INDEX_OPTIONS = %w(uniq).freeze
|
|
86
86
|
|
|
87
87
|
attr_accessor :name, :type
|
|
88
88
|
attr_reader :attr_options
|
|
@@ -95,7 +95,10 @@ module Gris
|
|
|
95
95
|
# if user provided "name:index" instead of "name:string:index"
|
|
96
96
|
# type should be set blank so GeneratedAttribute's constructor
|
|
97
97
|
# could set it to :string
|
|
98
|
-
|
|
98
|
+
if INDEX_OPTIONS.include?(type)
|
|
99
|
+
has_index = type
|
|
100
|
+
type = nil
|
|
101
|
+
end
|
|
99
102
|
|
|
100
103
|
type, attr_options = *parse_type_and_options(type)
|
|
101
104
|
type = type.to_sym if type
|
data/lib/gris/seed_loader.rb
CHANGED
data/lib/gris/setup.rb
CHANGED
|
@@ -40,11 +40,8 @@ Gris.cache.instance_eval do
|
|
|
40
40
|
super(key, options)
|
|
41
41
|
|
|
42
42
|
rescue ArgumentError => ex
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
else
|
|
47
|
-
raise ex
|
|
48
|
-
end
|
|
43
|
+
raise ex unless rescue_and_require && %r{^undefined class\/module (.+?)$} =~ ex.message
|
|
44
|
+
self.class.const_missing(Regexp.last_match(1))
|
|
45
|
+
fetch(key, options, false)
|
|
49
46
|
end
|
|
50
47
|
end
|
data/lib/gris/version.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module Gris
|
|
2
|
-
VERSION = '0.6.
|
|
2
|
+
VERSION = '0.6.2'.freeze
|
|
3
3
|
|
|
4
4
|
class Version
|
|
5
5
|
class << self
|
|
@@ -16,7 +16,7 @@ module Gris
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def next_level(level)
|
|
19
|
-
|
|
19
|
+
raise 'Unidentified Level' unless [:major, :minor, :patch].include?(level)
|
|
20
20
|
parts = Gris::VERSION.split('.').map(&:to_i)
|
|
21
21
|
if level == :major
|
|
22
22
|
parts[0] += 1
|
|
@@ -9,13 +9,13 @@ describe Gris::DateTimeHelpers do
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
it 'parses a date string' do
|
|
12
|
-
MY_TIME = '2011-01-02 17:00:23 UTC'
|
|
12
|
+
MY_TIME = '2011-01-02 17:00:23 UTC'.freeze
|
|
13
13
|
actual = @helper.string_to_datetime(MY_TIME)
|
|
14
14
|
expect(actual.to_s).to eq(MY_TIME)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
it 'converts seconds since epoch' do
|
|
18
|
-
SECONDS = '1429823204'
|
|
18
|
+
SECONDS = '1429823204'.freeze
|
|
19
19
|
actual = @helper.string_to_datetime(SECONDS)
|
|
20
20
|
expect(actual).to eq(Time.at(SECONDS.to_i))
|
|
21
21
|
end
|
|
@@ -26,7 +26,7 @@ describe Gris::Middleware::ErrorHandlers do
|
|
|
26
26
|
subject.use Gris::Middleware::ErrorHandlers
|
|
27
27
|
|
|
28
28
|
subject.get :generic_error do
|
|
29
|
-
|
|
29
|
+
raise 'api error'
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
subject.get :gris_error do
|
|
@@ -38,11 +38,11 @@ describe Gris::Middleware::ErrorHandlers do
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
subject.get :record_not_found do
|
|
41
|
-
|
|
41
|
+
raise ActiveRecord::RecordNotFound
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
subject.get :record_invalid do
|
|
45
|
-
|
|
45
|
+
raise ActiveRecord::RecordInvalid
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gris
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dylan Fareed
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-03-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|