operatic 0.2.0 → 0.3.0

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
  SHA256:
3
- metadata.gz: f5f46398654b0cda4099550dc86d85e82833fa9671722f901dfeb09a0c9ef6e5
4
- data.tar.gz: c5098edb779caedbefc2ddf39861ffd6e005315f5928da73b5eaaa04046c68fc
3
+ metadata.gz: 3d2d761cb5faa5c2c3033b701c7a716390cdefba8ebf2c13bbd20086375c81ff
4
+ data.tar.gz: 854bfdfc81e9c54866dc70f1c8773d11a664648e20d3bb33bab2a5fd4ca093fd
5
5
  SHA512:
6
- metadata.gz: 93c89546ab8bc0a51fd1e58e059a5ec5da145443fdffadc4072e8af304fad195d1034f31b37a446870fe7e230292d7a40bf0168cfc1cc536ceab4e7b251907fb
7
- data.tar.gz: 8a14b3e513e2416c55fc768612f0445697da7dabd331594d651c88f8da42c866db3bef42933d22ba44b3ef29b37dc5a6aa77b00af93360b7738c1563d32280c3
6
+ metadata.gz: cd7219716eaf92d39c26a9bd7072a90eb45a3d95c86fc784c2c94de6645b4bd1c3b7dc8fb7d802fafd59db93532b96cb3ee4f5a93cd1e4a30973146244fd165e
7
+ data.tar.gz: 139a4f9bf2cddaec695fed7095b6460aa2b3cf5433980e327a05fa0ebeddedab7d53df934c07fe5c835eb57f935d2c5153fdc5e6c3cdd2bd5a22e630c86097a9
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # CHANGELOG
2
+
3
+ ## Version 0.3.0 - 2019-11-27
4
+
5
+ - Implement `#to_h` not `#to_hash`. <https://github.com/benpickles/operatic/pull/4>
6
+
7
+ ## Version 0.2.0 - 2019-11-23
8
+
9
+ First official version hosted on [RubyGems.org](https://rubygems.org/gems/operatic).
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [![GitHub Actions status](https://github.com/benpickles/operatic/workflows/Ruby/badge.svg)](https://github.com/benpickles/operatic)
4
4
 
5
+ A minimal standard interface for your operations.
6
+
5
7
  ## Installation
6
8
 
7
9
  Add Operatic to your application's Gemfile and run `bundle install`.
@@ -36,13 +38,13 @@ end
36
38
  result = SayHello.call(name: 'Dave')
37
39
  result.success? # => true
38
40
  result.message # => "Hello Dave"
39
- result.to_hash # => {:message=>"Hello Dave"}
41
+ result.to_h # => {:message=>"Hello Dave"}
40
42
 
41
43
  result = SayHello.call
42
44
  result.failure? # => true
43
45
  result.success? # => false
44
46
  result.message # => nil
45
- result.to_hash # => {}
47
+ result.to_h # => {}
46
48
  ```
47
49
 
48
50
  A Rails controller might use Operatic like this:
@@ -69,11 +69,11 @@ module Operatic
69
69
  @success
70
70
  end
71
71
 
72
- # Returns the full hash of data attached to the result via {#success!},
73
- # {#failure!}, or convenience accessors added with {.generate}.
72
+ # Returns the full (frozen) hash of data attached to the result via
73
+ # {#success!}, {#failure!}, or convenience accessors added with {.generate}.
74
74
  #
75
75
  # @return [Hash]
76
- def to_hash
76
+ def to_h
77
77
  @data
78
78
  end
79
79
 
@@ -1,3 +1,3 @@
1
1
  module Operatic
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
data/lib/operatic.rb CHANGED
@@ -17,7 +17,7 @@ module Operatic
17
17
  # @param attrs [Hash<Symbol, anything>] an optional hash of key/values to
18
18
  # to the result. The class must have corresponding +attr_reader+s
19
19
  #
20
- # @return a [Result] which is fro
20
+ # @return a [Result]
21
21
  def call(attrs = nil)
22
22
  new(attrs)
23
23
  .tap(&:call)
@@ -95,12 +95,12 @@ module Operatic
95
95
  #
96
96
  # result = SayHello.call(name: 'Dave')
97
97
  # result.success? # => true
98
- # result.to_hash # => {:message=>"Hello Dave"}
98
+ # result.to_h # => {:message=>"Hello Dave"}
99
99
  #
100
100
  # result = SayHello.call
101
101
  # result.failure? # => true
102
102
  # result.success? # => false
103
- # result.to_hash # => {}
103
+ # result.to_h # => {}
104
104
  def call
105
105
  end
106
106
 
data/operatic.gemspec CHANGED
@@ -8,22 +8,22 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ['Ben Pickles']
9
9
  spec.email = ['spideryoung@gmail.com']
10
10
 
11
- spec.summary = 'Operations'
12
- spec.description = ''
11
+ spec.summary = 'A minimal standard interface for your operations'
12
+ spec.description = spec.summary
13
13
  spec.homepage = 'https://github.com/benpickles/operatic'
14
14
  spec.license = 'MIT'
15
15
 
16
- # spec.metadata['allowed_push_host'] = 'TODO: Set to 'http://mygemserver.com''
17
-
18
- spec.metadata['homepage_uri'] = spec.homepage
19
- # spec.metadata['source_code_uri'] = 'TODO: Put your gem's public repo URL here.'
20
- # spec.metadata['changelog_uri'] = 'TODO: Put your gem's CHANGELOG.md URL here.'
16
+ spec.metadata = {
17
+ 'changelog_uri' => 'https://github.com/benpickles/operatic/blob/master/CHANGELOG.md',
18
+ 'documentation_uri' => 'https://rubydoc.info/gems/operatic',
19
+ 'source_code_uri' => 'https://github.com/benpickles/operatic',
20
+ }
21
21
 
22
22
  spec.required_ruby_version = '>= 2.5.0'
23
23
 
24
24
  # Specify which files should be added to the gem when it is released.
25
25
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
26
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
26
+ spec.files = Dir.chdir(__dir__) do
27
27
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
28
  end
29
29
  spec.bindir = 'exe'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: operatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Pickles
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-23 00:00:00.000000000 Z
11
+ date: 2019-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
- description: ''
55
+ description: A minimal standard interface for your operations
56
56
  email:
57
57
  - spideryoung@gmail.com
58
58
  executables: []
@@ -62,6 +62,7 @@ files:
62
62
  - ".github/workflows/ruby.yml"
63
63
  - ".gitignore"
64
64
  - ".rspec"
65
+ - CHANGELOG.md
65
66
  - CODE_OF_CONDUCT.md
66
67
  - Gemfile
67
68
  - LICENSE.txt
@@ -78,7 +79,9 @@ homepage: https://github.com/benpickles/operatic
78
79
  licenses:
79
80
  - MIT
80
81
  metadata:
81
- homepage_uri: https://github.com/benpickles/operatic
82
+ changelog_uri: https://github.com/benpickles/operatic/blob/master/CHANGELOG.md
83
+ documentation_uri: https://rubydoc.info/gems/operatic
84
+ source_code_uri: https://github.com/benpickles/operatic
82
85
  post_install_message:
83
86
  rdoc_options: []
84
87
  require_paths:
@@ -97,5 +100,5 @@ requirements: []
97
100
  rubygems_version: 3.0.3
98
101
  signing_key:
99
102
  specification_version: 4
100
- summary: Operations
103
+ summary: A minimal standard interface for your operations
101
104
  test_files: []