mikado_graph_generator 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +37 -0
- data/.editorconfig +0 -2
- data/.gitignore +8 -13
- data/.rspec +2 -0
- data/.rubocop +1 -0
- data/.rubocop.disabled.yml +236 -0
- data/.rubocop.enabled.yml +374 -0
- data/.rubocop.yml +10 -0
- data/.ruby-version +1 -0
- data/.travis.yml +5 -2
- data/Gemfile +1 -1
- data/Gemfile.lock +66 -1
- data/Guardfile +56 -0
- data/README.md +7 -9
- data/Rakefile +2 -1
- data/example_usage.rb +6 -6
- data/lib/mikado_graph/version.rb +1 -1
- data/mikado_graph.gemspec +14 -9
- metadata +80 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9668c3aa3a4cbac985e84579b150178e63a3b155
|
4
|
+
data.tar.gz: de1a9a1372befe308df515bc7af3385b6d39f75e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c294f274b5a39dc63f13ad80bf3cd7c1a78ea37ac58a1980018f59aac5f8e21ffc879695c556926ded48b1f2197ce0fae038465dbb6bf739d47aa689efa6de3d
|
7
|
+
data.tar.gz: d6a43e88070ce788e8cad2c79ade43ff102bfbbe658a9fc34d665e6a0fef207360a680ad41a2e94b377e7ec8e33ccd49fe84364ed10b13e62b1a736adddf93cd
|
data/.codeclimate.yml
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
---
|
2
|
+
engines:
|
3
|
+
brakeman:
|
4
|
+
enabled: true
|
5
|
+
checks:
|
6
|
+
CVE_2015_3227:
|
7
|
+
enabled: false
|
8
|
+
bundler-audit:
|
9
|
+
enabled: true
|
10
|
+
duplication:
|
11
|
+
enabled: true
|
12
|
+
config:
|
13
|
+
languages:
|
14
|
+
- ruby
|
15
|
+
- javascript
|
16
|
+
- python
|
17
|
+
- php
|
18
|
+
fixme:
|
19
|
+
enabled: true
|
20
|
+
rubocop:
|
21
|
+
enabled: true
|
22
|
+
ratings:
|
23
|
+
paths:
|
24
|
+
- Gemfile.lock
|
25
|
+
- "**.erb"
|
26
|
+
- "**.haml"
|
27
|
+
- "**.rb"
|
28
|
+
- "**.rhtml"
|
29
|
+
- "**.slim"
|
30
|
+
- "**.inc"
|
31
|
+
- "**.js"
|
32
|
+
- "**.jsx"
|
33
|
+
- "**.module"
|
34
|
+
- "**.php"
|
35
|
+
- "**.py"
|
36
|
+
exclude_paths:
|
37
|
+
- spec/
|
data/.editorconfig
CHANGED
data/.gitignore
CHANGED
@@ -1,15 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
/
|
8
|
-
|
9
|
-
|
10
|
-
# rspec failure tracking
|
11
|
-
.rspec_status
|
12
|
-
|
13
|
-
.idea/
|
1
|
+
# Ignore all logfiles and tempfiles.
|
2
|
+
.DS_Store
|
3
|
+
.idea/*
|
4
|
+
coverage/
|
5
|
+
doc/
|
6
|
+
log/*.log
|
7
|
+
pkg/
|
8
|
+
tmp/
|
14
9
|
|
15
10
|
*.png
|
data/.rspec
CHANGED
data/.rubocop
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--display-cop-names
|
@@ -0,0 +1,236 @@
|
|
1
|
+
#
|
2
|
+
# Do not enforce any of these cops...
|
3
|
+
#
|
4
|
+
# Note: cops are ordered alphabetically.
|
5
|
+
#
|
6
|
+
|
7
|
+
require: rubocop-rspec
|
8
|
+
|
9
|
+
#
|
10
|
+
# This cop identifies places where a case-insensitive string comparison can better be implemented using casecmp.
|
11
|
+
#
|
12
|
+
# # bad
|
13
|
+
# str.downcase == 'abc'
|
14
|
+
# str.upcase.eql? 'ABC'
|
15
|
+
# 'abc' == str.downcase
|
16
|
+
# 'ABC'.eql? str.upcase
|
17
|
+
# str.downcase == str.downcase
|
18
|
+
#
|
19
|
+
# # good
|
20
|
+
# str.casecmp('ABC').zero?
|
21
|
+
# 'abc'.casecmp(str).zero?
|
22
|
+
#
|
23
|
+
Performance/Casecmp:
|
24
|
+
Enabled: false
|
25
|
+
|
26
|
+
#
|
27
|
+
# Place when conditions that use splat at the end of the list of when branches.
|
28
|
+
#
|
29
|
+
Performance/CaseWhenSplat:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
#
|
33
|
+
# Do not compute the size of statically sized objects.
|
34
|
+
#
|
35
|
+
Performance/FixedSize:
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
#
|
39
|
+
# This cop identifies places where Hash#merge! can be replaced by Hash#[]=.
|
40
|
+
#
|
41
|
+
# hash.merge!(a: 1)
|
42
|
+
# hash.merge!({'key' => 'value'})
|
43
|
+
# hash.merge!(a: 1, b: 2)
|
44
|
+
#
|
45
|
+
Performance/RedundantMerge:
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
#
|
49
|
+
# This cop looks for delegations, that could have been created automatically with delegate method.
|
50
|
+
#
|
51
|
+
# # bad
|
52
|
+
# def bar
|
53
|
+
# foo.bar
|
54
|
+
# end
|
55
|
+
#
|
56
|
+
# # good
|
57
|
+
# delegate :bar, to: :foo
|
58
|
+
#
|
59
|
+
Rails/Delegate:
|
60
|
+
Enabled: false
|
61
|
+
|
62
|
+
#
|
63
|
+
# Note: enable once we move to a newer version of Rails.
|
64
|
+
#
|
65
|
+
# This cop is used to identify usages of http methods like get, post, put, patch without the usage of
|
66
|
+
# keyword arguments in your tests and change them to use keyword arguments.
|
67
|
+
#
|
68
|
+
# # bad
|
69
|
+
# get :new, { user_id: 1 }
|
70
|
+
#
|
71
|
+
# # good
|
72
|
+
# get :new, params: { user_id: 1 }
|
73
|
+
#
|
74
|
+
Rails/HttpPositionalArguments:
|
75
|
+
Enabled: false
|
76
|
+
|
77
|
+
#
|
78
|
+
# Checks that tests use 'described_class'.
|
79
|
+
#
|
80
|
+
# Note: I can't figure out which is the correct cop so I've included both.
|
81
|
+
#
|
82
|
+
RSpec/DescribedClass:
|
83
|
+
Enabled: false
|
84
|
+
|
85
|
+
RSpec/DescribeClass:
|
86
|
+
Enabled: false
|
87
|
+
|
88
|
+
#
|
89
|
+
# Checks that the second argument to 'describe' specifies a method.
|
90
|
+
#
|
91
|
+
RSpec/DescribeMethod:
|
92
|
+
Enabled: false
|
93
|
+
|
94
|
+
#
|
95
|
+
# Checks for 'subject' definitions that come after 'let' definitions.
|
96
|
+
#
|
97
|
+
# # bad
|
98
|
+
# RSpec.describe User do
|
99
|
+
# let(:params) { blah }
|
100
|
+
# subject { described_class.new(params) }
|
101
|
+
#
|
102
|
+
# it 'is valid' do
|
103
|
+
# expect(subject.valid?).to be(true)
|
104
|
+
# end
|
105
|
+
# end
|
106
|
+
#
|
107
|
+
# # good
|
108
|
+
# RSpec.describe User do
|
109
|
+
# subject { described_class.new(params) }
|
110
|
+
#
|
111
|
+
# let(:params) { blah }
|
112
|
+
#
|
113
|
+
# it 'is valid' do
|
114
|
+
# expect(subject.valid?).to be(true)
|
115
|
+
# end
|
116
|
+
# end
|
117
|
+
#
|
118
|
+
RSpec/LeadingSubject:
|
119
|
+
Enabled: false
|
120
|
+
|
121
|
+
#
|
122
|
+
# This cop looks for uses of block comments (=begin...=end).
|
123
|
+
#
|
124
|
+
Style/BlockComments:
|
125
|
+
Enabled: false
|
126
|
+
|
127
|
+
#
|
128
|
+
# Check for if and case statements where each branch is used for assignment to the same variable when using
|
129
|
+
# the return of the condition can be used instead.
|
130
|
+
#
|
131
|
+
# # bad
|
132
|
+
# if foo
|
133
|
+
# bar = 1
|
134
|
+
# else
|
135
|
+
# bar = 2
|
136
|
+
# end
|
137
|
+
#
|
138
|
+
# # good
|
139
|
+
# bar = if foo
|
140
|
+
# 1
|
141
|
+
# else
|
142
|
+
# 2
|
143
|
+
# end
|
144
|
+
#
|
145
|
+
Style/ConditionalAssignment:
|
146
|
+
Enabled: false
|
147
|
+
|
148
|
+
#
|
149
|
+
# This cop checks for missing top-level documentation of classes and modules.
|
150
|
+
#
|
151
|
+
Style/Documentation:
|
152
|
+
Enabled: false
|
153
|
+
|
154
|
+
#
|
155
|
+
# This cop checks for uses of double negation (!!) to convert something to a boolean value. As this is both
|
156
|
+
# cryptic and usually redundant, it should be avoided.
|
157
|
+
#
|
158
|
+
Style/DoubleNegation:
|
159
|
+
Enabled: false
|
160
|
+
|
161
|
+
#
|
162
|
+
# This cop checks for the formatting of empty method definitions. By default it enforces empty method definitions to go
|
163
|
+
# on a single line (compact style), but it can be configured to enforce the end to go on its own line (expanded style.)
|
164
|
+
#
|
165
|
+
# Note: A method definition is not considered empty if it contains comments.
|
166
|
+
#
|
167
|
+
Style/EmptyMethod:
|
168
|
+
Enabled: false
|
169
|
+
|
170
|
+
#
|
171
|
+
# This cop is designed to help upgrade to Ruby 3.0. It will add the comment `# frozen_string_literal: true` to the top
|
172
|
+
# of files to enable frozen string literals. Frozen string literals will be default in Ruby 3.0. The comment will be
|
173
|
+
# added below a shebang and encoding comment. The frozen string literal comment is only valid in Ruby 2.3+.
|
174
|
+
#
|
175
|
+
Style/FrozenStringLiteralComment:
|
176
|
+
Enabled: false
|
177
|
+
|
178
|
+
#
|
179
|
+
# This cops checks for use of extend self or module_function in a module.
|
180
|
+
#
|
181
|
+
Style/ModuleFunction:
|
182
|
+
Enabled: false
|
183
|
+
|
184
|
+
#
|
185
|
+
# This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).
|
186
|
+
#
|
187
|
+
# # bad
|
188
|
+
# CONST = [1, 2, 3]
|
189
|
+
#
|
190
|
+
# # good
|
191
|
+
# CONST = [1, 2, 3].freeze
|
192
|
+
#
|
193
|
+
Style/MutableConstant:
|
194
|
+
Enabled: false
|
195
|
+
|
196
|
+
#
|
197
|
+
# This cop (by default) checks for uses of methods Hash#has_key? and Hash#has_value? where it enforces Hash#key? and
|
198
|
+
# Hash#value? It is configurable to enforce the inverse, using verbose method names also.
|
199
|
+
#
|
200
|
+
# EnforcedStyle: short
|
201
|
+
#
|
202
|
+
# # bad
|
203
|
+
# Hash#has_key?
|
204
|
+
# Hash#has_value?
|
205
|
+
#
|
206
|
+
# # good
|
207
|
+
# Hash#key?
|
208
|
+
# Hash#value?
|
209
|
+
#
|
210
|
+
# EnforcedStyle: verbose
|
211
|
+
#
|
212
|
+
# # bad
|
213
|
+
# Hash#key?
|
214
|
+
# Hash#value?
|
215
|
+
#
|
216
|
+
# # good
|
217
|
+
# Hash#has_key?
|
218
|
+
# Hash#has_value?
|
219
|
+
#
|
220
|
+
Style/PreferredHashMethods:
|
221
|
+
Enabled: false
|
222
|
+
|
223
|
+
#
|
224
|
+
# This cop checks whether the block parameters of a single-line method accepting a block match the names
|
225
|
+
# specified via configuration.
|
226
|
+
#
|
227
|
+
# For instance one can configure reduce(inject) to use |a, e| as parameters.
|
228
|
+
#
|
229
|
+
Style/SingleLineBlockParams:
|
230
|
+
Enabled: false
|
231
|
+
|
232
|
+
#
|
233
|
+
# This cop can check for the %w() syntax.
|
234
|
+
#
|
235
|
+
Style/WordArray:
|
236
|
+
Enabled: false
|
@@ -0,0 +1,374 @@
|
|
1
|
+
#
|
2
|
+
# Enforce all of these cops...
|
3
|
+
#
|
4
|
+
# Note: cops are ordered alphabetically.
|
5
|
+
#
|
6
|
+
|
7
|
+
require: rubocop-rspec
|
8
|
+
|
9
|
+
#
|
10
|
+
# This cop checks whether the end keywords are aligned properly.
|
11
|
+
#
|
12
|
+
# # good
|
13
|
+
# variable = if true
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
Lint/EndAlignment:
|
17
|
+
EnforcedStyleAlignWith: variable
|
18
|
+
|
19
|
+
#
|
20
|
+
# This cop looks for error classes inheriting from Exception and its standard library subclasses,
|
21
|
+
# excluding subclasses of StandardError.
|
22
|
+
#
|
23
|
+
Lint/InheritException:
|
24
|
+
EnforcedStyle: runtime_error
|
25
|
+
|
26
|
+
#
|
27
|
+
# This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored.
|
28
|
+
# The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
|
29
|
+
#
|
30
|
+
Metrics/BlockLength:
|
31
|
+
ExcludedMethods:
|
32
|
+
- describe
|
33
|
+
|
34
|
+
#
|
35
|
+
# This cop checks the length of lines in the source code.
|
36
|
+
#
|
37
|
+
Metrics/LineLength:
|
38
|
+
Max: 140
|
39
|
+
|
40
|
+
#
|
41
|
+
# This cop checks if the length of a method exceeds some maximum value.
|
42
|
+
#
|
43
|
+
Metrics/MethodLength:
|
44
|
+
Max: 15
|
45
|
+
|
46
|
+
#
|
47
|
+
# This cop is used to identify usages of select.first, select.last, find_all.first, and find_all.last and
|
48
|
+
# change them to use detect instead.
|
49
|
+
#
|
50
|
+
# ActiveRecord compatibility: ActiveRecord does not implement a detect method and find has its own meaning.
|
51
|
+
# Correcting ActiveRecord methods with this cop should be considered unsafe.
|
52
|
+
#
|
53
|
+
# # bad
|
54
|
+
# [].select { |item| true }.first
|
55
|
+
# [].select { |item| true }.last
|
56
|
+
# [].find_all { |item| true }.first
|
57
|
+
# [].find_all { |item| true }.last
|
58
|
+
#
|
59
|
+
# # good
|
60
|
+
# [].detect { |item| true }
|
61
|
+
# [].reverse.detect { |item| true }
|
62
|
+
#
|
63
|
+
Performance/Detect:
|
64
|
+
AutoCorrect: false
|
65
|
+
|
66
|
+
#
|
67
|
+
# This cop checks dynamic find_by_* methods. Use find_by instead of dynamic method.
|
68
|
+
# See. https://github.com/bbatsov/rails-style-guide#find_by
|
69
|
+
#
|
70
|
+
# NOTE: Do not autocorrect since we have non-dynamic finders that follow the dynamic finder naming convention
|
71
|
+
#
|
72
|
+
Rails/DynamicFindBy:
|
73
|
+
AutoCorrect: false
|
74
|
+
|
75
|
+
#
|
76
|
+
# Checks for long examples.
|
77
|
+
#
|
78
|
+
RSpec/ExampleLength:
|
79
|
+
Max: 20
|
80
|
+
|
81
|
+
#
|
82
|
+
# This cop checks for consistent style when specifying RSpec hooks which run for each example.
|
83
|
+
#
|
84
|
+
# # bad
|
85
|
+
# before(:each) do
|
86
|
+
# ...
|
87
|
+
# end
|
88
|
+
#
|
89
|
+
# # bad
|
90
|
+
# before(:example) do
|
91
|
+
# ...
|
92
|
+
# end
|
93
|
+
#
|
94
|
+
# # good
|
95
|
+
# before do
|
96
|
+
# ...
|
97
|
+
# end
|
98
|
+
#
|
99
|
+
RSpec/HookArgument:
|
100
|
+
EnforcedStyle: implicit
|
101
|
+
|
102
|
+
#
|
103
|
+
# Checks if examples contain too many 'expect' calls.
|
104
|
+
#
|
105
|
+
RSpec/MultipleExpectations:
|
106
|
+
Max: 3
|
107
|
+
|
108
|
+
#
|
109
|
+
# Checks for consistent method usage for negating expectations.
|
110
|
+
#
|
111
|
+
RSpec/NotToNot:
|
112
|
+
EnforcedStyle: to_not
|
113
|
+
|
114
|
+
#
|
115
|
+
# Check that the keys, separators, and values of a multi-line hash literal are aligned according
|
116
|
+
# to configuration. With 'key' everything is left aligned.
|
117
|
+
#
|
118
|
+
Style/AlignHash:
|
119
|
+
EnforcedHashRocketStyle: key
|
120
|
+
EnforcedColonStyle: key
|
121
|
+
EnforcedLastArgumentHashStyle: always_ignore
|
122
|
+
|
123
|
+
#
|
124
|
+
# Here we check if the parameters on a multi-line method call or definition are aligned.
|
125
|
+
#
|
126
|
+
Style/AlignParameters:
|
127
|
+
EnforcedStyle: with_fixed_indentation
|
128
|
+
|
129
|
+
#
|
130
|
+
# This cop checks how the 'whens' of a case expression are indented in relation to its 'case' or 'end' keyword.
|
131
|
+
#
|
132
|
+
Style/CaseIndentation:
|
133
|
+
EnforcedStyle: end
|
134
|
+
IndentOneStep: true
|
135
|
+
|
136
|
+
#
|
137
|
+
# This cop checks for the formatting of empty method definitions. By default it enforces empty method definitions
|
138
|
+
# to go on a single line (compact style).
|
139
|
+
#
|
140
|
+
Style/EmptyMethod:
|
141
|
+
Exclude:
|
142
|
+
- 'db/migrate/*'
|
143
|
+
|
144
|
+
#
|
145
|
+
# This cop checks for a line break before the first element in a multi-line hash.
|
146
|
+
#
|
147
|
+
# # bad
|
148
|
+
# { a: 1,
|
149
|
+
# b: 2}
|
150
|
+
#
|
151
|
+
# # good
|
152
|
+
# {
|
153
|
+
# a: 1,
|
154
|
+
# b: 2 }
|
155
|
+
#
|
156
|
+
Style/FirstHashElementLineBreak:
|
157
|
+
Enabled: true
|
158
|
+
|
159
|
+
#
|
160
|
+
# This cop checks for a line break before the first argument in a multi-line method call.
|
161
|
+
#
|
162
|
+
# # bad
|
163
|
+
# method(foo, bar,
|
164
|
+
# baz)
|
165
|
+
#
|
166
|
+
# # good
|
167
|
+
# method(
|
168
|
+
# foo, bar,
|
169
|
+
# baz)
|
170
|
+
#
|
171
|
+
# # ignored
|
172
|
+
# method foo, bar,
|
173
|
+
# baz
|
174
|
+
#
|
175
|
+
Style/FirstMethodArgumentLineBreak:
|
176
|
+
Enabled: true
|
177
|
+
|
178
|
+
# This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.
|
179
|
+
#
|
180
|
+
# # bad
|
181
|
+
# some_method(
|
182
|
+
# first_param,
|
183
|
+
# second_param)
|
184
|
+
#
|
185
|
+
# # good
|
186
|
+
# some_method(
|
187
|
+
# first_param,
|
188
|
+
# second_param)
|
189
|
+
#
|
190
|
+
Style/FirstParameterIndentation:
|
191
|
+
EnforcedStyle: consistent
|
192
|
+
|
193
|
+
#
|
194
|
+
# This cop checks the indentation of the first element in an array literal where the opening bracket and the
|
195
|
+
# first element are on separate lines.
|
196
|
+
#
|
197
|
+
# # consistent
|
198
|
+
# array = [
|
199
|
+
# :value
|
200
|
+
# ]
|
201
|
+
# and_in_a_method_call([
|
202
|
+
# :no_difference
|
203
|
+
# ])
|
204
|
+
#
|
205
|
+
Style/IndentArray:
|
206
|
+
EnforcedStyle: consistent
|
207
|
+
|
208
|
+
#
|
209
|
+
# This cops checks the indentation of the first key in a hash literal where the opening brace and the first key
|
210
|
+
# are on separate lines.
|
211
|
+
#
|
212
|
+
# # consistent
|
213
|
+
# hash = {
|
214
|
+
# key: :value
|
215
|
+
# }
|
216
|
+
# and_in_a_method_call({
|
217
|
+
# no: :difference
|
218
|
+
# })
|
219
|
+
#
|
220
|
+
Style/IndentHash:
|
221
|
+
EnforcedStyle: consistent
|
222
|
+
|
223
|
+
#
|
224
|
+
# This cop checks for uses of the lambda literal syntax.
|
225
|
+
#
|
226
|
+
# # literal
|
227
|
+
# f = ->(x) { x }
|
228
|
+
# f = ->(x) do
|
229
|
+
# x
|
230
|
+
# end
|
231
|
+
#
|
232
|
+
Style/Lambda:
|
233
|
+
EnforcedStyle: literal
|
234
|
+
|
235
|
+
#
|
236
|
+
# This cop checks presence of parentheses in method calls containing parameters. As in popular Ruby's frameworks a lot
|
237
|
+
# of methods should always be called without parentheses, users can ignore them by passing their names to IgnoredMethods
|
238
|
+
# option.
|
239
|
+
#
|
240
|
+
# # bad
|
241
|
+
# array.delete e
|
242
|
+
#
|
243
|
+
# # good
|
244
|
+
# array.delete(e)
|
245
|
+
#
|
246
|
+
# # good if `puts` is listed in IgnoredMethods
|
247
|
+
# puts 'test'
|
248
|
+
#
|
249
|
+
Style/MethodCallWithArgsParentheses:
|
250
|
+
Enabled: true
|
251
|
+
IgnoredMethods:
|
252
|
+
- add_development_dependency
|
253
|
+
- after_initialize
|
254
|
+
- assert
|
255
|
+
- assert_contents
|
256
|
+
- assert_empty
|
257
|
+
- assert_equal
|
258
|
+
- assert_held
|
259
|
+
- assert_nil
|
260
|
+
- assert_presence_of
|
261
|
+
- assert_raises
|
262
|
+
- assert_should_strip_whitespace
|
263
|
+
- assert_time_within
|
264
|
+
- attr_accessor
|
265
|
+
- attr_reader
|
266
|
+
- attr_writer
|
267
|
+
- attribute
|
268
|
+
- autocomplete_for
|
269
|
+
- before_action
|
270
|
+
- belongs_to
|
271
|
+
- column
|
272
|
+
- delegate
|
273
|
+
- describe
|
274
|
+
- extend
|
275
|
+
- field
|
276
|
+
- guard
|
277
|
+
- gem
|
278
|
+
- goto
|
279
|
+
- has_many
|
280
|
+
- in_line_ajax_action
|
281
|
+
- include
|
282
|
+
- it
|
283
|
+
- it_behaves_like
|
284
|
+
- link
|
285
|
+
- puts
|
286
|
+
- raise
|
287
|
+
- redefine_const
|
288
|
+
- redirect_to
|
289
|
+
- render
|
290
|
+
- require
|
291
|
+
- require_relative
|
292
|
+
- ruby
|
293
|
+
- scope
|
294
|
+
- should
|
295
|
+
- source
|
296
|
+
- task
|
297
|
+
- to
|
298
|
+
- to_not
|
299
|
+
- validate
|
300
|
+
- validates
|
301
|
+
- validates_numericality_of
|
302
|
+
- validates_presence_of
|
303
|
+
- within
|
304
|
+
|
305
|
+
#
|
306
|
+
# This cop checks that closing brace of a multi-line method call must be on the line after the last
|
307
|
+
# argument of the call.
|
308
|
+
#
|
309
|
+
# # symmetrical: bad
|
310
|
+
# # new_line: good
|
311
|
+
# # same_line: bad
|
312
|
+
# foo(a,
|
313
|
+
# b
|
314
|
+
# )
|
315
|
+
#
|
316
|
+
# # symmetrical: bad
|
317
|
+
# # new_line: bad
|
318
|
+
# # same_line: good
|
319
|
+
# foo(
|
320
|
+
# a,
|
321
|
+
# b)
|
322
|
+
#
|
323
|
+
# # symmetrical: good
|
324
|
+
# # new_line: bad
|
325
|
+
# # same_line: good
|
326
|
+
# foo(a,
|
327
|
+
# b)
|
328
|
+
#
|
329
|
+
# # symmetrical: good
|
330
|
+
# # new_line: good
|
331
|
+
# # same_line: bad
|
332
|
+
# foo(
|
333
|
+
# a,
|
334
|
+
# b
|
335
|
+
# )
|
336
|
+
#
|
337
|
+
Style/MultilineMethodCallBraceLayout:
|
338
|
+
EnforcedStyle: new_line
|
339
|
+
|
340
|
+
#
|
341
|
+
# This cop checks the indentation of the method name part in method calls that span more than one line.
|
342
|
+
#
|
343
|
+
# # good
|
344
|
+
# while a
|
345
|
+
# .b
|
346
|
+
# something
|
347
|
+
# end
|
348
|
+
#
|
349
|
+
Style/MultilineMethodCallIndentation:
|
350
|
+
EnforcedStyle: indented
|
351
|
+
|
352
|
+
#
|
353
|
+
# This cop looks for uses of Perl-style global variables.
|
354
|
+
#
|
355
|
+
Style/SpecialGlobalVars:
|
356
|
+
EnforcedStyle: use_english_names
|
357
|
+
|
358
|
+
#
|
359
|
+
# Checks if uses of quotes match the configured preference.
|
360
|
+
#
|
361
|
+
Style/StringLiterals:
|
362
|
+
EnforcedStyle: double_quotes
|
363
|
+
|
364
|
+
#
|
365
|
+
# This cop makes sure that all numbered variables use snake_case for their numbering.
|
366
|
+
#
|
367
|
+
# # bad
|
368
|
+
# variable1 = 1
|
369
|
+
#
|
370
|
+
# # good
|
371
|
+
# variable_1 = 1
|
372
|
+
#
|
373
|
+
Style/VariableNumber:
|
374
|
+
EnforcedStyle: snake_case
|
data/.rubocop.yml
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.4.0
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,59 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mikado_graph_generator (0.2.
|
4
|
+
mikado_graph_generator (0.2.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
ast (2.3.0)
|
10
|
+
coderay (1.1.1)
|
9
11
|
diff-lcs (1.3)
|
12
|
+
ffi (1.9.17)
|
13
|
+
formatador (0.2.5)
|
14
|
+
guard (2.14.1)
|
15
|
+
formatador (>= 0.2.4)
|
16
|
+
listen (>= 2.7, < 4.0)
|
17
|
+
lumberjack (~> 1.0)
|
18
|
+
nenv (~> 0.1)
|
19
|
+
notiffany (~> 0.0)
|
20
|
+
pry (>= 0.9.12)
|
21
|
+
shellany (~> 0.0)
|
22
|
+
thor (>= 0.18.1)
|
23
|
+
guard-bundler (2.1.0)
|
24
|
+
bundler (~> 1.0)
|
25
|
+
guard (~> 2.2)
|
26
|
+
guard-compat (~> 1.1)
|
27
|
+
guard-compat (1.2.1)
|
28
|
+
guard-rspec (4.7.3)
|
29
|
+
guard (~> 2.1)
|
30
|
+
guard-compat (~> 1.1)
|
31
|
+
rspec (>= 2.99.0, < 4.0)
|
32
|
+
guard-rubocop (1.2.0)
|
33
|
+
guard (~> 2.0)
|
34
|
+
rubocop (~> 0.20)
|
35
|
+
listen (3.1.5)
|
36
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
37
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
38
|
+
ruby_dep (~> 1.2)
|
39
|
+
lumberjack (1.0.11)
|
40
|
+
method_source (0.8.2)
|
41
|
+
nenv (0.3.0)
|
42
|
+
notiffany (0.1.1)
|
43
|
+
nenv (~> 0.1)
|
44
|
+
shellany (~> 0.0)
|
45
|
+
parser (2.3.3.1)
|
46
|
+
ast (~> 2.2)
|
47
|
+
powerpack (0.1.1)
|
48
|
+
pry (0.10.4)
|
49
|
+
coderay (~> 1.1.0)
|
50
|
+
method_source (~> 0.8.1)
|
51
|
+
slop (~> 3.4)
|
52
|
+
rainbow (2.2.1)
|
10
53
|
rake (10.5.0)
|
54
|
+
rb-fsevent (0.9.8)
|
55
|
+
rb-inotify (0.9.8)
|
56
|
+
ffi (>= 0.5.0)
|
11
57
|
rspec (3.5.0)
|
12
58
|
rspec-core (~> 3.5.0)
|
13
59
|
rspec-expectations (~> 3.5.0)
|
@@ -21,16 +67,35 @@ GEM
|
|
21
67
|
diff-lcs (>= 1.2.0, < 2.0)
|
22
68
|
rspec-support (~> 3.5.0)
|
23
69
|
rspec-support (3.5.0)
|
70
|
+
rubocop (0.47.1)
|
71
|
+
parser (>= 2.3.3.1, < 3.0)
|
72
|
+
powerpack (~> 0.1)
|
73
|
+
rainbow (>= 1.99.1, < 3.0)
|
74
|
+
ruby-progressbar (~> 1.7)
|
75
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
76
|
+
rubocop-rspec (1.10.0)
|
77
|
+
rubocop (>= 0.42.0)
|
24
78
|
ruby-graphviz (1.2.2)
|
79
|
+
ruby-progressbar (1.8.1)
|
80
|
+
ruby_dep (1.5.0)
|
81
|
+
shellany (0.0.1)
|
82
|
+
slop (3.6.0)
|
83
|
+
thor (0.19.4)
|
84
|
+
unicode-display_width (1.1.3)
|
25
85
|
|
26
86
|
PLATFORMS
|
27
87
|
ruby
|
28
88
|
|
29
89
|
DEPENDENCIES
|
30
90
|
bundler (~> 1.14)
|
91
|
+
guard-bundler
|
92
|
+
guard-rspec
|
93
|
+
guard-rubocop
|
31
94
|
mikado_graph_generator!
|
32
95
|
rake (~> 10.0)
|
33
96
|
rspec (~> 3.0)
|
97
|
+
rubocop (~> 0.47)
|
98
|
+
rubocop-rspec (~> 1.10)
|
34
99
|
ruby-graphviz (~> 1.2)
|
35
100
|
|
36
101
|
BUNDLED WITH
|
data/Guardfile
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
## Uncomment and set this to only include directories you want to watch
|
5
|
+
# directories %w(app processing config test spec features) \
|
6
|
+
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
7
|
+
|
8
|
+
## Note: if you are using the `directories` clause above and you are not
|
9
|
+
## watching the project directory ('.'), then you will want to move
|
10
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
11
|
+
#
|
12
|
+
# $ mkdir config
|
13
|
+
# $ mv Guardfile config/
|
14
|
+
# $ ln -s config/Guardfile .
|
15
|
+
#
|
16
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
17
|
+
|
18
|
+
guard :bundler do
|
19
|
+
require "guard/bundler"
|
20
|
+
require "guard/bundler/verify"
|
21
|
+
helper = Guard::Bundler::Verify.new
|
22
|
+
|
23
|
+
files = ["Gemfile"]
|
24
|
+
files += Dir["*.gemspec"] if files.any? { |f| helper.uses_gemspec?(f) }
|
25
|
+
|
26
|
+
# Assume files are symlinked from somewhere
|
27
|
+
files.each { |file| watch(helper.real_path(file)) }
|
28
|
+
end
|
29
|
+
|
30
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
31
|
+
# rspec may be run, below are examples of the most common uses.
|
32
|
+
# * bundler: 'bundle exec rspec'
|
33
|
+
# * bundler binstubs: 'bin/rspec'
|
34
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
35
|
+
# installed the spring binstubs per the docs)
|
36
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
37
|
+
# * 'just' rspec: 'rspec'
|
38
|
+
|
39
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
40
|
+
require "guard/rspec/dsl"
|
41
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
42
|
+
|
43
|
+
# Feel free to open issues for suggestions and improvements
|
44
|
+
|
45
|
+
# RSpec files
|
46
|
+
rspec = dsl.rspec
|
47
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
48
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
49
|
+
watch(rspec.spec_files)
|
50
|
+
|
51
|
+
watch(/.+\.rb$/)
|
52
|
+
end
|
53
|
+
|
54
|
+
guard :rubocop, cli: ["-S", "-D"] do
|
55
|
+
watch(/.+\.rb$/)
|
56
|
+
end
|
data/README.md
CHANGED
@@ -34,16 +34,16 @@ You can use this gem's DSL in the following way to create a Mikado Graph generat
|
|
34
34
|
require "mikado_graph"
|
35
35
|
|
36
36
|
MikadoGraph::Generator.define do
|
37
|
-
state("State A").depends_on
|
38
|
-
state("State B").depends_on
|
37
|
+
state("State A").depends_on do
|
38
|
+
state("State B").depends_on do
|
39
39
|
state("State D")
|
40
40
|
state("State E")
|
41
|
-
|
42
|
-
state("State C").depends_on
|
41
|
+
end
|
42
|
+
state("State C").depends_on do
|
43
43
|
state("State F")
|
44
44
|
state("State G")
|
45
|
-
|
46
|
-
|
45
|
+
end
|
46
|
+
end
|
47
47
|
end.generate("png", "img/example_usage.png") # generate takes GraphViz format and output path
|
48
48
|
```
|
49
49
|
|
@@ -55,7 +55,7 @@ ruby example_usage.rb
|
|
55
55
|
|
56
56
|
This will utilize the *GraphViz* `dot` command to create this PNG output of the above Mikado Graph generator definition:
|
57
57
|
|
58
|
-
![
|
58
|
+
![Example Usage](https://github.com/snasirca/mikado_graph_generator/blob/master/img/example_usage.png)
|
59
59
|
|
60
60
|
NOTE: If you don't provide any parameters to `generate`, it'll default to a `dot` output in the STDOUT.
|
61
61
|
|
@@ -63,8 +63,6 @@ NOTE: If you don't provide any parameters to `generate`, it'll default to a `dot
|
|
63
63
|
|
64
64
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
65
65
|
|
66
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
67
|
-
|
68
66
|
## Contributing
|
69
67
|
|
70
68
|
Bug reports and pull requests are welcome on GitHub at https://github.com/snasirca/mikado_graph_generator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/Rakefile
CHANGED
data/example_usage.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
require "mikado_graph"
|
2
2
|
|
3
3
|
MikadoGraph::Generator.define do
|
4
|
-
state("State A").depends_on
|
5
|
-
state("State B").depends_on
|
4
|
+
state("State A").depends_on do
|
5
|
+
state("State B").depends_on do
|
6
6
|
state("State D")
|
7
7
|
state("State E")
|
8
|
-
|
9
|
-
state("State C").depends_on
|
8
|
+
end
|
9
|
+
state("State C").depends_on do
|
10
10
|
state("State F")
|
11
11
|
state("State G")
|
12
|
-
|
13
|
-
|
12
|
+
end
|
13
|
+
end
|
14
14
|
end.generate("png", "img/example_usage.png")
|
data/lib/mikado_graph/version.rb
CHANGED
data/mikado_graph.gemspec
CHANGED
@@ -4,17 +4,17 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require "mikado_graph/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.authors
|
10
|
-
spec.email
|
7
|
+
spec.name = "mikado_graph_generator"
|
8
|
+
spec.version = MikadoGraph::VERSION
|
9
|
+
spec.authors = ["Shahriyar Nasir"]
|
10
|
+
spec.email = ["contact@snasir.ca"]
|
11
11
|
|
12
|
-
spec.summary
|
13
|
-
spec.description
|
14
|
-
spec.homepage
|
15
|
-
spec.license
|
12
|
+
spec.summary = "Mikado Graph generator"
|
13
|
+
spec.description = "Provides a simple DSL for generating Mikado Graphs using GraphViz."
|
14
|
+
spec.homepage = "https://github.com/snasirca/mikado_graph_generator"
|
15
|
+
spec.license = "MIT"
|
16
16
|
|
17
|
-
spec.files
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
18
|
f.match(%r{^(test|spec|features)/})
|
19
19
|
end
|
20
20
|
spec.require_paths = ["lib"]
|
@@ -23,4 +23,9 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
24
|
spec.add_development_dependency "rspec", "~> 3.0"
|
25
25
|
spec.add_development_dependency "ruby-graphviz", "~> 1.2"
|
26
|
+
spec.add_development_dependency "rubocop", "~> 0.47"
|
27
|
+
spec.add_development_dependency "rubocop-rspec", "~> 1.10"
|
28
|
+
spec.add_development_dependency "guard-rspec"
|
29
|
+
spec.add_development_dependency "guard-bundler"
|
30
|
+
spec.add_development_dependency "guard-rubocop"
|
26
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mikado_graph_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shahriyar Nasir
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,76 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.47'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.47'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.10'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.10'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: guard-rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: guard-bundler
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: guard-rubocop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
69
139
|
description: Provides a simple DSL for generating Mikado Graphs using GraphViz.
|
70
140
|
email:
|
71
141
|
- contact@snasir.ca
|
@@ -73,18 +143,26 @@ executables: []
|
|
73
143
|
extensions: []
|
74
144
|
extra_rdoc_files: []
|
75
145
|
files:
|
146
|
+
- ".codeclimate.yml"
|
76
147
|
- ".editorconfig"
|
77
148
|
- ".gitignore"
|
78
149
|
- ".rspec"
|
150
|
+
- ".rubocop"
|
151
|
+
- ".rubocop.disabled.yml"
|
152
|
+
- ".rubocop.enabled.yml"
|
153
|
+
- ".rubocop.yml"
|
154
|
+
- ".ruby-version"
|
79
155
|
- ".travis.yml"
|
80
156
|
- Gemfile
|
81
157
|
- Gemfile.lock
|
158
|
+
- Guardfile
|
82
159
|
- LICENSE.txt
|
83
160
|
- README.md
|
84
161
|
- Rakefile
|
85
162
|
- bin/console
|
86
163
|
- bin/setup
|
87
164
|
- example_usage.rb
|
165
|
+
- img/example_usage.png
|
88
166
|
- lib/mikado_graph.rb
|
89
167
|
- lib/mikado_graph/dependencies.rb
|
90
168
|
- lib/mikado_graph/generator.rb
|