substance_operation 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +8 -0
  3. data/lib/substance_operation.rb +33 -0
  4. metadata +47 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2785e6e596c35430d737cd5d18c25887abd4406978201b7abb6c0dc340e3b40b
4
+ data.tar.gz: '085fe1c9df22eb6a88390fefd5e9c24a2a82f006402adb7ea127d8dcf4474db2'
5
+ SHA512:
6
+ metadata.gz: dc859f9fe178d84629a1dc83b17db975047caee8ab56788dd49ef29a522f8cab3fa2cbd37b7b0f832d07a2e20d8bb89bd670413bb43c8b0d79e4cc490b6b52e5
7
+ data.tar.gz: 9e259c7e0cd1548b099e8aa59619d5972b7597a82334c5204183c74144e6943fb0603c9415fbe7168e42042f449c5ecd165ed2f23a89fb6878bb995163ac0c55
@@ -0,0 +1,8 @@
1
+ begin
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+ rescue LoadError
8
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Operation
4
+ #
5
+ # A generic operation whose actual steps are to be implemented by base classes
6
+ module Substance
7
+ class Operation
8
+ # Returns the result of running the operation
9
+ attr_reader :result
10
+
11
+ def initialize(user)
12
+ @user = user
13
+ end
14
+
15
+ def process(*)
16
+ raise \
17
+ NotImplementedError,
18
+ "Operation classes must implement their own process"
19
+ end
20
+
21
+ # Has the operation completed succesfully?
22
+ def success?
23
+ success
24
+ end
25
+
26
+ protected
27
+
28
+ attr_accessor :success
29
+ attr_accessor :user
30
+
31
+ attr_writer :result
32
+ end
33
+ end
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: substance_operation
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ole Palm
8
+ - Jakob Skjerning
9
+ - Jakob Dam Jensen
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2018-05-18 00:00:00.000000000 Z
14
+ dependencies: []
15
+ description: Make it easier to create user based operations
16
+ email: ole.palm@substancelab.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - Rakefile
22
+ - lib/substance_operation.rb
23
+ homepage: https://github.com/substancelab/substance_operation
24
+ licenses:
25
+ - MIT
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 2.7.3
44
+ signing_key:
45
+ specification_version: 4
46
+ summary: Make it easier to create user based operations
47
+ test_files: []