vedeu_cli 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rubocop.yml +182 -0
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +4 -0
  6. data/.yardopts +4 -0
  7. data/Gemfile +4 -0
  8. data/Guardfile +8 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +66 -0
  11. data/Rakefile +10 -0
  12. data/config/rubocop_disabled.yml +50 -0
  13. data/config/rubocop_enabled.yml +1039 -0
  14. data/lib/vedeu/cli/application.rb +133 -0
  15. data/lib/vedeu/cli/helpers.rb +139 -0
  16. data/lib/vedeu/cli/main.rb +39 -0
  17. data/lib/vedeu/cli/templates/application/.gitignore +1 -0
  18. data/lib/vedeu/cli/templates/application/.ruby-version +1 -0
  19. data/lib/vedeu/cli/templates/application/Gemfile +4 -0
  20. data/lib/vedeu/cli/templates/application/LICENSE.txt +24 -0
  21. data/lib/vedeu/cli/templates/application/README.md +18 -0
  22. data/lib/vedeu/cli/templates/application/app/controllers/application_controller.erb +7 -0
  23. data/lib/vedeu/cli/templates/application/app/controllers/name.erb +22 -0
  24. data/lib/vedeu/cli/templates/application/app/helpers/application_helper.erb +9 -0
  25. data/lib/vedeu/cli/templates/application/app/helpers/name.erb +11 -0
  26. data/lib/vedeu/cli/templates/application/app/models/keymaps/_global_.rb +8 -0
  27. data/lib/vedeu/cli/templates/application/app/models/keymaps/name.erb +3 -0
  28. data/lib/vedeu/cli/templates/application/app/views/interfaces/name.erb +67 -0
  29. data/lib/vedeu/cli/templates/application/app/views/name.erb +36 -0
  30. data/lib/vedeu/cli/templates/application/app/views/templates/name.erb +0 -0
  31. data/lib/vedeu/cli/templates/application/application.erb +22 -0
  32. data/lib/vedeu/cli/templates/application/bin/name +9 -0
  33. data/lib/vedeu/cli/templates/application/config/app_name.erb +1 -0
  34. data/lib/vedeu/cli/templates/application/config/configuration.erb +33 -0
  35. data/lib/vedeu/cli/templates/application/lib/.gitkeep +0 -0
  36. data/lib/vedeu/cli/templates/application/test/.gitkeep +0 -0
  37. data/lib/vedeu/cli/templates/application/vendor/.gitkeep +0 -0
  38. data/lib/vedeu/cli/version.rb +10 -0
  39. data/lib/vedeu/cli/view.rb +86 -0
  40. data/lib/vedeu_cli.rb +21 -0
  41. data/test/lib/vedeu/cli/application_test.rb +37 -0
  42. data/test/lib/vedeu/cli/helpers_test.rb +197 -0
  43. data/test/lib/vedeu/cli/main_test.rb +60 -0
  44. data/test/lib/vedeu/cli/version_test.rb +12 -0
  45. data/test/lib/vedeu/cli/view_test.rb +38 -0
  46. data/test/lib/vedeu_cli_test.rb +11 -0
  47. data/test/test_helper.rb +46 -0
  48. data/vedeu_cli.gemspec +36 -0
  49. metadata +288 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6ceb900d439a45c716eb717d489d98c135303247
4
+ data.tar.gz: 6ea6454c602ffe89316bd3f44b4e55fcea21019a
5
+ SHA512:
6
+ metadata.gz: e90b96bd975f558c2ef1fb0f09509948ca8f2cc20f2b4aa589e8b8804d4e393f6ca2e15f2ce6adf60cc32237dac3c5c2fb4feba2782bd5e6696489adab792931
7
+ data.tar.gz: 22ecdb0724b08d13cf89bc6e80b045881c2fcc3231af56344534c6771fb7d9e3e1c21bb10ebb563f7492535c6e5f7962ba4d46c1b3d52692837dd18edba55aff
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .tags
11
+ .tags_sorted_by_file
data/.rubocop.yml ADDED
@@ -0,0 +1,182 @@
1
+ # This is the default configuration file. Enabling and disabling is configured
2
+ # in separate files. This file adds all other parameters apart from Enabled.
3
+
4
+ inherit_from:
5
+ - config/rubocop_enabled.yml
6
+ - config/rubocop_disabled.yml
7
+
8
+ # Common configuration.
9
+ AllCops:
10
+ # Include gemspec and Rakefile
11
+ Include:
12
+ - '**/*.gemspec'
13
+ - '**/*.podspec'
14
+ - '**/*.jbuilder'
15
+ - '**/*.rake'
16
+ - '**/*.opal'
17
+ - '**/Gemfile'
18
+ - '**/Rakefile'
19
+ - '**/Capfile'
20
+ - '**/Guardfile'
21
+ - '**/Podfile'
22
+ - '**/Thorfile'
23
+ - '**/Vagrantfile'
24
+ - '**/Berksfile'
25
+ - '**/Cheffile'
26
+ - '**/Vagabondfile'
27
+ Exclude:
28
+ - 'test/**/*'
29
+ - 'vendor/**/*'
30
+ # By default, the rails cops are not run. Override in project or home
31
+ # directory .rubocop.yml files, or by giving the -R/--rails option.
32
+ RunRailsCops: false
33
+ # Cop names are not displayed in offense messages by default. Change behavior
34
+ # by overriding DisplayCopNames, or by giving the -D/--display-cop-names
35
+ # option.
36
+ DisplayCopNames: true
37
+ # Style guide URLs are not displayed in offense messages by default. Change
38
+ # behavior by overriding DisplayStyleGuide, or by giving the
39
+ # -S/--display-style-guide option.
40
+ DisplayStyleGuide: false
41
+ # Additional cops that do not reference a style guide rule may be enabled by
42
+ # default. Change behavior by overriding StyleGuideCopsOnly, or by giving
43
+ # the --only-guide-cops option.
44
+ StyleGuideCopsOnly: false
45
+
46
+ Style/EmptyLinesAroundBlockBody:
47
+ EnforcedStyle: no_empty_lines
48
+
49
+ Style/EmptyLinesAroundClassBody:
50
+ EnforcedStyle: empty_lines
51
+
52
+ Style/EmptyLinesAroundModuleBody:
53
+ EnforcedStyle: empty_lines
54
+
55
+ # Built-in global variables are allowed by default.
56
+ Style/GlobalVars:
57
+ AllowedVariables: [$LIB_DIR]
58
+
59
+ # `MinBodyLength` defines the number of lines of the a body of an if / unless
60
+ # needs to have to trigger this cop
61
+ Style/GuardClause:
62
+ MinBodyLength: 1
63
+
64
+ Style/IfUnlessModifier:
65
+ MaxLineLength: 80
66
+
67
+ Style/IndentationWidth:
68
+ Width: 2
69
+
70
+ # Checks the indentation of the first key in a hash literal.
71
+ Style/IndentHash:
72
+ # The value `special_inside_parentheses` means that hash literals with braces
73
+ # that have their opening brace on the same line as a surrounding opening
74
+ # round parenthesis, shall have their first key indented relative to the
75
+ # first position inside the parenthesis.
76
+ # The value `consistent` means that the indentation of the first key shall
77
+ # always be relative to the first position of the line where the opening
78
+ # brace is.
79
+ EnforcedStyle: special_inside_parentheses
80
+ SupportedStyles:
81
+ - special_inside_parentheses
82
+ - consistent
83
+
84
+ Style/ModuleFunction:
85
+ Enabled: false
86
+
87
+ Style/Next:
88
+ # With `always` all conditions at the end of an iteration needs to be
89
+ # replaced by next - with `skip_modifier_ifs` the modifier if like this one
90
+ # are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
91
+ EnforcedStyle: skip_modifier_ifs
92
+ # `MinBodyLength` defines the number of lines of the a body of an if / unless
93
+ # needs to have to trigger this cop
94
+ MinBodyLength: 3
95
+ SupportedStyles:
96
+ - skip_modifier_ifs
97
+ - always
98
+
99
+ Style/SpaceAroundEqualsInParameterDefault:
100
+ EnforcedStyle: space
101
+
102
+ Style/SpaceBeforeBlockBraces:
103
+ EnforcedStyle: space
104
+
105
+ Style/SpaceInsideBlockBraces:
106
+ EnforcedStyle: space
107
+
108
+ Style/SpaceInsideHashLiteralBraces:
109
+ EnforcedStyle: space
110
+
111
+ Style/TrailingBlankLines:
112
+ EnforcedStyle: final_newline
113
+
114
+ Style/TrailingComma:
115
+ EnforcedStyleForMultiline: comma
116
+
117
+ ##################### Metrics ##################################
118
+
119
+ Metrics/AbcSize:
120
+ # The ABC size is a calculated magnitude, so this number can be a Fixnum or
121
+ # a Float.
122
+ Max: 20
123
+
124
+ Metrics/BlockNesting:
125
+ Max: 3
126
+
127
+ Metrics/ClassLength:
128
+ CountComments: false # count full line comments?
129
+ Max: 100
130
+
131
+ # Avoid complex methods.
132
+ Metrics/CyclomaticComplexity:
133
+ Max: 10
134
+
135
+ Metrics/LineLength:
136
+ Max: 80
137
+ # To make it possible to copy or click on URIs in the code, we allow lines
138
+ # contaning a URI to be longer than Max.
139
+ AllowURI: true
140
+ URISchemes:
141
+ - http
142
+ - https
143
+
144
+ Metrics/MethodLength:
145
+ CountComments: false # count full line comments?
146
+ Max: 70
147
+
148
+ Metrics/ParameterLists:
149
+ Max: 5
150
+ CountKeywordArgs: true
151
+
152
+ Metrics/PerceivedComplexity:
153
+ Max: 12
154
+
155
+ ##################### Lint ##################################
156
+
157
+ # Allow safe assignment in conditions.
158
+ Lint/AssignmentInCondition:
159
+ AllowSafeAssignment: true
160
+
161
+ # Align ends correctly.
162
+ Lint/EndAlignment:
163
+ # The value `keyword` means that `end` should be aligned with the matching
164
+ # keyword (if, while, etc.).
165
+ # The value `variable` means that in assignments, `end` should be aligned
166
+ # with the start of the variable on the left hand side of `=`. In all other
167
+ # situations, `end` should still be aligned with the keyword.
168
+ AlignWith: keyword
169
+ SupportedStyles:
170
+ - keyword
171
+ - variable
172
+
173
+ Lint/DefEndAlignment:
174
+ # The value `def` means that `end` should be aligned with the def keyword.
175
+ # The value `start_of_line` means that `end` should be aligned with method
176
+ # calls like `private`, `public`, etc, if present in front of the `def`
177
+ # keyword on the same line.
178
+ AlignWith: start_of_line
179
+ SupportedStyles:
180
+ - start_of_line
181
+ - def
182
+
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.2
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install: gem install bundler -v 1.10.6
data/.yardopts ADDED
@@ -0,0 +1,4 @@
1
+ --private
2
+ --protected
3
+ --embed-mixin ClassMethods
4
+ -
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vedeu_cli.gemspec
4
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,8 @@
1
+ guard :minitest, all_after_pass: true,
2
+ focus_on_failed: true,
3
+ env: { 'NO_SIMPLECOV' => true } do
4
+ watch(%r{^test/(.*)_test\.rb})
5
+ watch(%r{^lib/(.+)\.rb}) { |m| "test/lib/#{m[1]}_test.rb" }
6
+ watch(%r{^test/test_helper\.rb}) { 'test' }
7
+ watch(%r{^lib/(.+)all\.rb}) { 'test' }
8
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Gavin Laking
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,66 @@
1
+ [![Code Climate](https://codeclimate.com/github/gavinlaking/vedeu_cli.png)](https://codeclimate.com/github/gavinlaking/vedeu_cli)
2
+ [![Build Status](https://travis-ci.org/gavinlaking/vedeu_cli.svg?branch=master)](https://travis-ci.org/gavinlaking/vedeu_cli)
3
+
4
+ # Vedeu CLI
5
+
6
+ Vedeu (vee-dee-you; aka VDU) is my attempt at creating a terminal based
7
+ application framework without the need for Ncurses. Please see
8
+ [Vedeu](https://github.com/gavinlaking/vedeu). Vedeu CLI is a plugin for
9
+ Vedeu which provides the means to generate client application code suitable
10
+ for Vedeu.
11
+
12
+
13
+ ## Example
14
+
15
+ Coming soon!
16
+
17
+
18
+ ## Documentation & Usage
19
+
20
+ Coming soon!
21
+
22
+
23
+ ## Development / Contributing
24
+
25
+ * Documentation hosted at [RubyDoc](http://rubydoc.info/gems/vedeu_cli).
26
+ * Source hosted at [GitHub](https://github.com/gavinlaking/vedeu_cli).
27
+
28
+ Pull requests are very welcome! Please try to follow these simple rules if
29
+ applicable:
30
+
31
+ * Please create a topic branch for every separate change you make.
32
+ * Make sure your patches are well tested.
33
+ * Update the [Yard](http://yardoc.org/) documentation.
34
+ (Use `yard stats --list-undoc` to locate undocumented code)
35
+ * Update the [README](https://github.com/gavinlaking/vedeu_cli/blob/master/README.md).
36
+ * Please **do not change** the version number.
37
+
38
+ Any branch on the repository that is not `master` is probably experimental; do
39
+ not rely on anything in these branches. Typically, `twerks` will be merged
40
+ into `master` before a release, and branches prefixed with `spike/` are me
41
+ playing with ideas.
42
+
43
+ ### General contribution help
44
+
45
+ 1. Fork it ([https://github.com/gavinlaking/vedeu_cli/fork](https://github.com/gavinlaking/vedeu_cli/fork))
46
+ 2. Clone it
47
+ 3. Run `bundle`
48
+ 4. Run `rake` (runs all tests and coverage report) or `bundle exec guard`
49
+ 5. Create your feature branch (`git checkout -b my-new-feature`)
50
+ 6. Write some tests, write some code, **have some fun!**
51
+ 7. Commit your changes (`git commit -am 'Add some feature'`)
52
+ 8. Push to the branch (`git push origin my-new-feature`)
53
+ 9. Create a new pull request.
54
+
55
+
56
+ ## Author & Contributors
57
+
58
+ ### Author
59
+
60
+ [Gavin Laking](https://github.com/gavinlaking)
61
+ ([@gavinlaking](http://twitter.com/gavinlaking))
62
+
63
+ ### Contributors
64
+
65
+ [https://github.com/gavinlaking/vedeu_cli/graphs/contributors](https://github.com/gavinlaking/vedeu_cli/graphs/contributors)
66
+
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << 'test'
6
+ t.libs << 'lib'
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task default: :test
@@ -0,0 +1,50 @@
1
+ # These are all the cops that are disabled in the default configuration.
2
+
3
+ Style/AutoResourceCleanup:
4
+ Description: 'Suggests the usage of an auto resource cleanup version of a method (if available).'
5
+ Enabled: false
6
+
7
+ Style/CollectionMethods:
8
+ Description: 'Preferred collection methods.'
9
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size'
10
+ Enabled: false
11
+
12
+ Style/Encoding:
13
+ Description: 'Use UTF-8 as the source file encoding.'
14
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#utf-8'
15
+ Enabled: false
16
+
17
+ Style/InlineComment:
18
+ Description: 'Avoid inline comments.'
19
+ Enabled: false
20
+
21
+ Style/MethodCalledOnDoEndBlock:
22
+ Description: 'Avoid chaining a method call on a do...end block.'
23
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
24
+ Enabled: false
25
+
26
+ Style/MissingElse:
27
+ Description: >-
28
+ Require if/case expressions to have an else branches.
29
+ If enabled, it is recommended that
30
+ Style/UnlessElse and Style/EmptyElse be enabled.
31
+ This will conflict with Style/EmptyElse if
32
+ Style/EmptyElse is configured to style "both"
33
+ Enabled: false
34
+ EnforcedStyle: both
35
+ SupportedStyles:
36
+ # if - warn when an if expression is missing an else branch
37
+ # case - warn when a case expression is misisng an else branch
38
+ # both - warn when an if or case expression is missing an else branch
39
+ - if
40
+ - case
41
+ - both
42
+
43
+ Style/SymbolArray:
44
+ Description: 'Use %i or %I for arrays of symbols.'
45
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-i'
46
+ Enabled: false
47
+
48
+ Style/ExtraSpacing:
49
+ Description: 'Do not use unnecessary spacing.'
50
+ Enabled: false