action_command 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 87d1121215dc01fba0fddbb6f7f33e6465e59c47
4
+ data.tar.gz: ff9229f8fbafcc73acd0c9f787b7ff0d6b9fa1d5
5
+ SHA512:
6
+ metadata.gz: f650e9313684e1bf93c798a4f28ab86479d711645f6a69a716fa7d4cf3f0d5f390eb9283d2a0af9242e04363cc7d0137863ec4e5806cafaba4df122001b71404
7
+ data.tar.gz: 596f8d569c692586c246ab41a863aa2a803bfbb244eea42617f2a3f10783af8f4b0d15c79e82a214159dcd475a842a3133ad3b53cbb7825f070eb4a8db4a4562
data/.codeclimate.yml ADDED
@@ -0,0 +1,26 @@
1
+ engines:
2
+ rubocop:
3
+ enabled: true
4
+ checks:
5
+ Rubocop/Metrics/LineLength:
6
+ enabled: true
7
+ max: 99
8
+ Rubocop/Style/TrailingWhitespace:
9
+ enabled: false
10
+ Rubocop/Style/RedundantReturn:
11
+ enabled: false
12
+
13
+ golint:
14
+ enabled: true
15
+ eslint:
16
+ enabled: true
17
+ csslint:
18
+ enabled: true
19
+ ratings:
20
+ paths:
21
+ - app/**
22
+ - lib/**
23
+ - "**.rb"
24
+ - "**.go"
25
+ exclude_paths:
26
+ - doc/**/*
data/.gitignore ADDED
@@ -0,0 +1,36 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ ## Specific to RubyMotion:
14
+ .dat*
15
+ .repl_history
16
+ build/
17
+
18
+ ## Documentation cache and generated files:
19
+ /.yardoc/
20
+ /_yardoc/
21
+ /doc/
22
+ /rdoc/
23
+
24
+ ## Environment normalization:
25
+ /.bundle/
26
+ /vendor/bundle
27
+ /lib/bundler/man/
28
+
29
+ # for a library or gem, you might want to ignore these files since the code is
30
+ # intended to run in multiple environments; otherwise, check them in:
31
+ # Gemfile.lock
32
+ # .ruby-version
33
+ # .ruby-gemset
34
+
35
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
36
+ .rvmrc
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,11 @@
1
+ AllCops:
2
+ Exclude:
3
+ - Guardfile
4
+ Metrics/LineLength:
5
+ Max: 99
6
+
7
+ Style/TrailingWhitespace:
8
+ Enabled: false
9
+
10
+ Style/RedundantReturn:
11
+ Enabled: false
data/.travis.yml ADDED
@@ -0,0 +1,21 @@
1
+ sudo: false
2
+ cache: bundler
3
+ language: ruby
4
+ rvm:
5
+ - 2.3.0
6
+ env:
7
+ # this doesn't do anything for MRI or RBX, but it doesn't hurt them either
8
+ # for JRuby, it enables us to get more accurate coverage data
9
+ - JRUBY_OPTS="--debug"
10
+ matrix:
11
+ allow_failures:
12
+ - rvm: ruby-head
13
+ - rvm: rbx-3
14
+ fast_finish: true
15
+ before_install: gem update --remote bundler
16
+ install:
17
+ - bundle install --retry=3
18
+ script:
19
+ - bundle exec rspec
20
+ - bundle exec rubocop
21
+
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at chris@nourishfunding.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in action_command.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,112 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ action_command (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.2.0)
10
+ codeclimate-test-reporter (0.4.8)
11
+ simplecov (>= 0.7.1, < 1.0.0)
12
+ coderay (1.1.0)
13
+ colorize (0.7.7)
14
+ diff-lcs (1.2.5)
15
+ docile (1.1.5)
16
+ ffi (1.9.10)
17
+ formatador (0.2.5)
18
+ guard (2.13.0)
19
+ formatador (>= 0.2.4)
20
+ listen (>= 2.7, <= 4.0)
21
+ lumberjack (~> 1.0)
22
+ nenv (~> 0.1)
23
+ notiffany (~> 0.0)
24
+ pry (>= 0.9.12)
25
+ shellany (~> 0.0)
26
+ thor (>= 0.18.1)
27
+ guard-compat (1.2.1)
28
+ guard-rspec (4.6.4)
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
+ json (1.8.3)
36
+ listen (3.0.6)
37
+ rb-fsevent (>= 0.9.3)
38
+ rb-inotify (>= 0.9.7)
39
+ lumberjack (1.0.10)
40
+ method_source (0.8.2)
41
+ nenv (0.3.0)
42
+ notiffany (0.0.8)
43
+ nenv (~> 0.1)
44
+ shellany (~> 0.0)
45
+ parser (2.3.0.5)
46
+ ast (~> 2.2)
47
+ powerpack (0.1.1)
48
+ pry (0.10.3)
49
+ coderay (~> 1.1.0)
50
+ method_source (~> 0.8.1)
51
+ slop (~> 3.4)
52
+ rainbow (2.1.0)
53
+ rake (10.5.0)
54
+ rake_command_filter (0.1.2)
55
+ colorize
56
+ rb-fsevent (0.9.7)
57
+ rb-inotify (0.9.7)
58
+ ffi (>= 0.5.0)
59
+ rspec (3.4.0)
60
+ rspec-core (~> 3.4.0)
61
+ rspec-expectations (~> 3.4.0)
62
+ rspec-mocks (~> 3.4.0)
63
+ rspec-core (3.4.2)
64
+ rspec-support (~> 3.4.0)
65
+ rspec-expectations (3.4.0)
66
+ diff-lcs (>= 1.2.0, < 2.0)
67
+ rspec-support (~> 3.4.0)
68
+ rspec-mocks (3.4.1)
69
+ diff-lcs (>= 1.2.0, < 2.0)
70
+ rspec-support (~> 3.4.0)
71
+ rspec-support (3.4.1)
72
+ rubocop (0.37.2)
73
+ parser (>= 2.3.0.4, < 3.0)
74
+ powerpack (~> 0.1)
75
+ rainbow (>= 1.99.1, < 3.0)
76
+ ruby-progressbar (~> 1.7)
77
+ unicode-display_width (~> 0.3)
78
+ ruby-progressbar (1.7.5)
79
+ shellany (0.0.1)
80
+ simplecov (0.11.2)
81
+ docile (~> 1.1.0)
82
+ json (~> 1.8)
83
+ simplecov-html (~> 0.10.0)
84
+ simplecov-html (0.10.0)
85
+ slop (3.6.0)
86
+ terminal-notifier (1.6.3)
87
+ terminal-notifier-guard (1.6.4)
88
+ thor (0.19.1)
89
+ unicode-display_width (0.3.1)
90
+ yard (0.8.7.6)
91
+
92
+ PLATFORMS
93
+ ruby
94
+
95
+ DEPENDENCIES
96
+ action_command!
97
+ bundler (~> 1.11)
98
+ codeclimate-test-reporter
99
+ guard
100
+ guard-rspec
101
+ guard-rubocop
102
+ rake (~> 10.0)
103
+ rake_command_filter
104
+ rspec (~> 3.0)
105
+ rubocop (~> 0.37.0)
106
+ simplecov (~> 0.11)
107
+ terminal-notifier
108
+ terminal-notifier-guard
109
+ yard (~> 0.8)
110
+
111
+ BUNDLED WITH
112
+ 1.11.2
data/Guardfile ADDED
@@ -0,0 +1,75 @@
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 lib 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 :rubocop do
19
+ watch(%r{.+\.rb$})
20
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
21
+ end
22
+
23
+ # Note: The cmd option is now required due to the increasing number of ways
24
+ # rspec may be run, below are examples of the most common uses.
25
+ # * bundler: 'bundle exec rspec'
26
+ # * bundler binstubs: 'bin/rspec'
27
+ # * spring: 'bin/rspec' (This will use spring if running and you have
28
+ # installed the spring binstubs per the docs)
29
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
30
+ # * 'just' rspec: 'rspec'
31
+
32
+ guard :rspec, cmd: "bundle exec rspec" do
33
+ require "guard/rspec/dsl"
34
+ dsl = Guard::RSpec::Dsl.new(self)
35
+
36
+ # Feel free to open issues for suggestions and improvements
37
+
38
+ # RSpec files
39
+ rspec = dsl.rspec
40
+ watch(rspec.spec_helper) { rspec.spec_dir }
41
+ watch(rspec.spec_support) { rspec.spec_dir }
42
+ watch(rspec.spec_files)
43
+
44
+ # Ruby files
45
+ ruby = dsl.ruby
46
+ dsl.watch_spec_files_for(ruby.lib_files)
47
+
48
+ # Rails files
49
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
50
+ dsl.watch_spec_files_for(rails.app_files)
51
+ dsl.watch_spec_files_for(rails.views)
52
+
53
+ watch(rails.controllers) do |m|
54
+ [
55
+ rspec.spec.("routing/#{m[1]}_routing"),
56
+ rspec.spec.("controllers/#{m[1]}_controller"),
57
+ rspec.spec.("acceptance/#{m[1]}")
58
+ ]
59
+ end
60
+
61
+ # Rails config changes
62
+ watch(rails.spec_helper) { rspec.spec_dir }
63
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
64
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
65
+
66
+ # Capybara features specs
67
+ watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
68
+ watch(rails.layouts) { |m| rspec.spec.("features/#{m[1]}") }
69
+
70
+ # Turnip features and steps
71
+ watch(%r{^spec/acceptance/(.+)\.feature$})
72
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
73
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
74
+ end
75
+ end
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 chrisjones-tripletri
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Chris Jones
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,44 @@
1
+ [![Build Status](https://travis-ci.org/chrisjones-tripletri/action_command.svg?branch=master)](https://travis-ci.org/chrisjones-tripletri/action_command)
2
+ [![Test Coverage](https://codeclimate.com/github/chrisjones-tripletri/action_command/badges/coverage.svg)](https://codeclimate.com/github/chrisjones-tripletri/action_command/coverage)
3
+ [![Code Climate](https://codeclimate.com/github/chrisjones-tripletri/action_command/badges/gpa.svg)](https://codeclimate.com/github/chrisjones-tripletri/action_command)
4
+ [![Inline docs](http://inch-ci.org/github/chrisjones-tripletri/action_command.svg)](http://inch-ci.org/github/chrisjones-tripletri/action_command)
5
+
6
+ # ActionCommand
7
+
8
+ This gem is currently in an experimentation phase, and should not be used by others.
9
+
10
+ ## Installation
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ ```ruby
15
+ gem 'action_command'
16
+ ```
17
+
18
+ And then execute:
19
+
20
+ $ bundle
21
+
22
+ Or install it yourself as:
23
+
24
+ $ gem install action_command
25
+
26
+ ## Usage
27
+
28
+ TODO: Write usage instructions here
29
+
30
+ ## Development
31
+
32
+ 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.
33
+
34
+ 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).
35
+
36
+ ## Contributing
37
+
38
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/action_command. 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.
39
+
40
+
41
+ ## License
42
+
43
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
44
+
data/Rakefile ADDED
@@ -0,0 +1,18 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+ require 'rubocop/rake_task'
4
+ require 'yard'
5
+ require 'rake_command_filter'
6
+
7
+ RSpec::Core::RakeTask.new(:spec)
8
+ RuboCop::RakeTask.new(:rubocop)
9
+ YARD::Rake::YardocTask.new(:yard)
10
+
11
+ RakeCommandFilter::RakeTask.new(:validate) do
12
+ desc 'Run full validation'
13
+ run_definition(RakeCommandFilter::RubocopCommandDefinition.new)
14
+ run_definition(RakeCommandFilter::RSpecCommandDefinition.new)
15
+ run_definition(RakeCommandFilter::YardCommandDefinition.new)
16
+ end
17
+
18
+ task default: :spec
@@ -0,0 +1,36 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'action_command/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'action_command'
8
+ spec.version = ActionCommand::VERSION
9
+ spec.authors = ['Chris Jones']
10
+ spec.email = ['chris@tripletriangle.com']
11
+
12
+ spec.summary = '{Reuse code easily in controllers, rake tasks, tests, or outside rails.'
13
+ spec.description = 'Simple implementation of command pattern focused on reuse in'\
14
+ ' multiple contexts'
15
+ spec.homepage = 'https://github.com/chrisjones-tripletri/action_command'
16
+ spec.license = 'MIT'
17
+
18
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+ spec.bindir = 'exe'
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ['lib']
22
+
23
+ spec.add_development_dependency 'bundler', '~> 1.11'
24
+ spec.add_development_dependency 'rake', '~> 10.0'
25
+ spec.add_development_dependency 'rspec', '~> 3.0'
26
+ spec.add_development_dependency 'rubocop', '~> 0.37.0'
27
+ spec.add_development_dependency 'simplecov', '~> 0.11'
28
+ spec.add_development_dependency 'codeclimate-test-reporter'
29
+ spec.add_development_dependency 'yard', '~> 0.8'
30
+ spec.add_development_dependency 'guard'
31
+ spec.add_development_dependency 'guard-rubocop'
32
+ spec.add_development_dependency 'guard-rspec'
33
+ spec.add_development_dependency 'terminal-notifier'
34
+ spec.add_development_dependency 'terminal-notifier-guard'
35
+ spec.add_development_dependency 'rake_command_filter'
36
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'action_command'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require 'irb'
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here