commande 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9138bf2b694ca329c484c5ae02d2ee885cf2810e
4
- data.tar.gz: 608cad9501f9cc6722e513721fced30061bf1bc0
3
+ metadata.gz: d25e8ec7120ae92efec0d9213a85eb7406ba2cae
4
+ data.tar.gz: 511b45c1ca6eb7d0b9f45a2322cc1c8e41f74e73
5
5
  SHA512:
6
- metadata.gz: 79731f5f849e680b495a7b38a6d185b719a0985205a38079a6829ec50b3c353299e2be367350be40e37fc1fcaafbcd6af76888d757cbb7f01cdfb98cdc9b8fa9
7
- data.tar.gz: 8263d5a510b6f5151f9ed895912f29009f5b6e06d79386bea942a61758f857fa28fe4066be0183679fc7ab98dfcb11f26c3e43dd8e7c1a58162462ff1637c711
6
+ metadata.gz: 5866e974388a65b94f57d4b053db322734f68090e71c438b6f47ffd20440625ceb9e205cd2a8628f94c6424f5b61b58469d35697d842b75a869be9e49f98aa07
7
+ data.tar.gz: 602a9ffdd2b80d1c18cc3cef9702ce6bea0e230928c421151389bfaadd7aca264214cf6d75db2dc4dca4be658d0d33ddfd49f6e2d9680b4fdd8e7903386ce3a8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1
4
+ - Alias `output` as `outputs`
5
+
3
6
  ## 0.3.0
4
7
  - Naming gem as `commande`.
5
8
  - Github require continues to work because `command` can be required.
data/README.md CHANGED
@@ -1,115 +1,116 @@
1
- # Command
2
- [![Build Status: master](https://travis-ci.com/SleeplessByte/command.svg?branch=master)](https://travis-ci.com/SleeplessByte/command)
3
- [![Gem Version](https://badge.fury.io/rb/commande.svg)](https://badge.fury.io/rb/commande)
4
- [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
5
-
6
- Command adds the [Command Design Pattern](https://sourcemaking.com/design_patterns/command) to any `Class`.
7
-
8
- This was based on `Hanami::Interactor`, and started off as adding a direct `call` on the singleton class, before that
9
- was added to Hanami's. After working with different interactors and command-style gems, including ways to organize
10
- units for execution and without depending on other utility classes, `command` was born.
11
-
12
- Because [`command`](https://rubygems.org/gems/command) has been taken on rubygems (but not updated since 2013), and
13
- [`commando`](https://rubygems.org/gems/commando) has been taken (but not updated since 2009) and the Dutch `opdracht` is
14
- probably not pronounceable by most people using this, I've decided to register this on the French
15
- [`commande`](https://rubygems.org/gems/commande).
16
-
17
- However, if you are using this directly from GitHub, you can continue using it as is, without renaming, as long as you
18
- change the Gemfile line to `require: 'command'`.
19
-
20
- ```Ruby
21
- # Gemfile
22
- gem 'commande', require: 'command'
23
- ```
24
-
25
- ## Installation
26
-
27
- Add this line to your application's Gemfile:
28
-
29
- ```Ruby
30
- gem 'commande'
31
- ```
32
-
33
- or alternatively if you would like to refer to commande as `Command`:
34
-
35
- ```Ruby
36
- gem 'commande', require: 'command'
37
- ```
38
-
39
- And then execute:
40
-
41
- $ bundle
42
-
43
- Or install it yourself as:
44
-
45
- $ gem install commande
46
-
47
- ## Usage
48
-
49
- There are examples in the code and the tests. Here is a crude and basic example:
50
-
51
- ```Ruby
52
- class FetchSecondInput
53
- include Commande
54
-
55
- output :fetched
56
-
57
- def call(*args)
58
- # always define call
59
- self.fetched = args.second
60
- end
61
-
62
- def valid?(*args)
63
- args.length == 2
64
- end
65
-
66
- private
67
-
68
- attr_accessor :fetched
69
- end
70
-
71
- result = FetchSecondInput.call(42, 'gem')
72
- result.successful? # => true
73
- result.fetched # => 'gem'
74
-
75
- result = FetchSecondInput.call(42, 'gem', 'three is a crowd')
76
- result.successful? # => false
77
- result.fetched # => nil
78
- ```
79
-
80
- ## Testing
81
-
82
- There are some `Minitest` assertions included in this library.
83
-
84
- ```Ruby
85
- require 'commande/minitest'
86
- ```
87
- | Assert | Refute | |
88
- |:---:|:---:|:---:|
89
- | `assert_successful(command_result)` | `refute_successful` | passes if the command is successful?
90
- | `assert_valid(command, *args_for_valid)` | `refute_valid` | passes if the command is valid
91
- | `assert_with_error(expected, actual)` | `refute_with_error` | passes if the command has a certain error message
92
-
93
- ## Development
94
-
95
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
96
- You can also run `bin/console` for an interactive prompt that will allow you to experiment.
97
-
98
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the
99
- version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version,
100
- push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
101
-
102
- ## Contributing
103
-
104
- Bug reports and pull requests are welcome on GitHub at [SleeplessByte/commmand](https://github.com/SleeplessByte/command).
105
- This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
106
- the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
107
-
108
- ## License
109
-
110
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
111
-
112
- ## Code of Conduct
113
-
114
- Everyone interacting in the Shrine::ConfigurableStorage project’s codebases, issue trackers, chat rooms and mailing
115
- lists is expected to follow the [code of conduct](https://github.com/SleeplessByte/command/blob/master/CODE_OF_CONDUCT.md).
1
+ # Command
2
+ [![Build Status: master](https://travis-ci.com/SleeplessByte/command.svg?branch=master)](https://travis-ci.com/SleeplessByte/command)
3
+ [![Gem Version](https://badge.fury.io/rb/commande.svg)](https://badge.fury.io/rb/commande)
4
+ [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/070b90f32c99865db49f/maintainability)](https://codeclimate.com/github/SleeplessByte/command/maintainability)
6
+
7
+ Command adds the [Command Design Pattern](https://sourcemaking.com/design_patterns/command) to any `Class`.
8
+
9
+ This was based on `Hanami::Interactor`, and started off as adding a direct `call` on the singleton class, before that
10
+ was added to Hanami's. After working with different interactors and command-style gems, including ways to organize
11
+ units for execution and without depending on other utility classes, `command` was born.
12
+
13
+ Because [`command`](https://rubygems.org/gems/command) has been taken on rubygems (but not updated since 2013), and
14
+ [`commando`](https://rubygems.org/gems/commando) has been taken (but not updated since 2009) and the Dutch `opdracht` is
15
+ probably not pronounceable by most people using this, I've decided to register this on the French
16
+ [`commande`](https://rubygems.org/gems/commande).
17
+
18
+ However, if you are using this directly from GitHub, you can continue using it as is, without renaming, as long as you
19
+ change the Gemfile line to `require: 'command'`.
20
+
21
+ ```Ruby
22
+ # Gemfile
23
+ gem 'commande', require: 'command'
24
+ ```
25
+
26
+ ## Installation
27
+
28
+ Add this line to your application's Gemfile:
29
+
30
+ ```Ruby
31
+ gem 'commande'
32
+ ```
33
+
34
+ or alternatively if you would like to refer to commande as `Command`:
35
+
36
+ ```Ruby
37
+ gem 'commande', require: 'command'
38
+ ```
39
+
40
+ And then execute:
41
+
42
+ $ bundle
43
+
44
+ Or install it yourself as:
45
+
46
+ $ gem install commande
47
+
48
+ ## Usage
49
+
50
+ There are examples in the code and the tests. Here is a crude and basic example:
51
+
52
+ ```Ruby
53
+ class FetchSecondInput
54
+ include Commande
55
+
56
+ output :fetched
57
+
58
+ def call(*args)
59
+ # always define call
60
+ self.fetched = args.second
61
+ end
62
+
63
+ def valid?(*args)
64
+ args.length == 2
65
+ end
66
+
67
+ private
68
+
69
+ attr_accessor :fetched
70
+ end
71
+
72
+ result = FetchSecondInput.call(42, 'gem')
73
+ result.successful? # => true
74
+ result.fetched # => 'gem'
75
+
76
+ result = FetchSecondInput.call(42, 'gem', 'three is a crowd')
77
+ result.successful? # => false
78
+ result.fetched # => nil
79
+ ```
80
+
81
+ ## Testing
82
+
83
+ There are some `Minitest` assertions included in this library.
84
+
85
+ ```Ruby
86
+ require 'commande/minitest'
87
+ ```
88
+ | Assert | Refute | |
89
+ |:---:|:---:|:---:|
90
+ | `assert_successful(command_result)` | `refute_successful` | passes if the command is successful?
91
+ | `assert_valid(command, *args_for_valid)` | `refute_valid` | passes if the command is valid
92
+ | `assert_with_error(expected, actual)` | `refute_with_error` | passes if the command has a certain error message
93
+
94
+ ## Development
95
+
96
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
97
+ You can also run `bin/console` for an interactive prompt that will allow you to experiment.
98
+
99
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the
100
+ version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version,
101
+ push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
102
+
103
+ ## Contributing
104
+
105
+ Bug reports and pull requests are welcome on GitHub at [SleeplessByte/commmand](https://github.com/SleeplessByte/command).
106
+ This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
107
+ the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
108
+
109
+ ## License
110
+
111
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
112
+
113
+ ## Code of Conduct
114
+
115
+ Everyone interacting in the Shrine::ConfigurableStorage project’s codebases, issue trackers, chat rooms and mailing
116
+ lists is expected to follow the [code of conduct](https://github.com/SleeplessByte/command/blob/master/CODE_OF_CONDUCT.md).
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- module Commande
4
- VERSION = '0.3.0'
5
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Commande
4
+ VERSION = '0.3.1'
5
+ end
data/lib/commande.rb CHANGED
@@ -434,5 +434,7 @@ module Commande
434
434
  outputs[name.to_sym] = "@#{name}"
435
435
  end
436
436
  end
437
+
438
+ alias outputs output
437
439
  end
438
440
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commande
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derk-Jan Karrenbeld
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-09 00:00:00.000000000 Z
11
+ date: 2018-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler