cuprum-cli 0.1.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 +7 -0
- data/CHANGELOG.md +34 -0
- data/CODE_OF_CONDUCT.md +10 -0
- data/LICENSE +21 -0
- data/README.md +163 -0
- data/lib/cuprum/cli/argument.rb +172 -0
- data/lib/cuprum/cli/arguments/class_methods.rb +283 -0
- data/lib/cuprum/cli/arguments.rb +16 -0
- data/lib/cuprum/cli/coercion.rb +131 -0
- data/lib/cuprum/cli/command.rb +102 -0
- data/lib/cuprum/cli/commands/ci/report.rb +121 -0
- data/lib/cuprum/cli/commands/ci/rspec_command.rb +108 -0
- data/lib/cuprum/cli/commands/ci/rspec_each_command.rb +185 -0
- data/lib/cuprum/cli/commands/ci.rb +12 -0
- data/lib/cuprum/cli/commands/echo_command.rb +76 -0
- data/lib/cuprum/cli/commands/file/generate_file.rb +141 -0
- data/lib/cuprum/cli/commands/file/new_command.rb +86 -0
- data/lib/cuprum/cli/commands/file/render_erb.rb +88 -0
- data/lib/cuprum/cli/commands/file/resolve_template.rb +136 -0
- data/lib/cuprum/cli/commands/file/templates/rspec.rb.erb +14 -0
- data/lib/cuprum/cli/commands/file/templates/ruby.rb.erb +29 -0
- data/lib/cuprum/cli/commands/file/templates.rb +71 -0
- data/lib/cuprum/cli/commands/file.rb +14 -0
- data/lib/cuprum/cli/commands.rb +12 -0
- data/lib/cuprum/cli/dependencies/file_system/mock.rb +297 -0
- data/lib/cuprum/cli/dependencies/file_system.rb +247 -0
- data/lib/cuprum/cli/dependencies/standard_io/helpers.rb +138 -0
- data/lib/cuprum/cli/dependencies/standard_io/mock.rb +85 -0
- data/lib/cuprum/cli/dependencies/standard_io.rb +110 -0
- data/lib/cuprum/cli/dependencies/system_command/mock.rb +57 -0
- data/lib/cuprum/cli/dependencies/system_command.rb +147 -0
- data/lib/cuprum/cli/dependencies.rb +25 -0
- data/lib/cuprum/cli/errors/files/file_not_writeable.rb +42 -0
- data/lib/cuprum/cli/errors/files/missing_parameter.rb +71 -0
- data/lib/cuprum/cli/errors/files/missing_template.rb +36 -0
- data/lib/cuprum/cli/errors/files/template_error.rb +37 -0
- data/lib/cuprum/cli/errors/files/template_not_resolved.rb +54 -0
- data/lib/cuprum/cli/errors/files.rb +19 -0
- data/lib/cuprum/cli/errors/system_command_failure.rb +44 -0
- data/lib/cuprum/cli/errors.rb +11 -0
- data/lib/cuprum/cli/integrations/thor/arguments_parser.rb +99 -0
- data/lib/cuprum/cli/integrations/thor/registry.rb +42 -0
- data/lib/cuprum/cli/integrations/thor/task.rb +211 -0
- data/lib/cuprum/cli/integrations/thor.rb +14 -0
- data/lib/cuprum/cli/integrations.rb +8 -0
- data/lib/cuprum/cli/metadata.rb +215 -0
- data/lib/cuprum/cli/option.rb +165 -0
- data/lib/cuprum/cli/options/class_methods.rb +232 -0
- data/lib/cuprum/cli/options/quiet.rb +32 -0
- data/lib/cuprum/cli/options/verbose.rb +32 -0
- data/lib/cuprum/cli/options.rb +18 -0
- data/lib/cuprum/cli/registry.rb +141 -0
- data/lib/cuprum/cli/rspec/deferred/arguments_examples.rb +203 -0
- data/lib/cuprum/cli/rspec/deferred/ci/report_examples.rb +450 -0
- data/lib/cuprum/cli/rspec/deferred/ci.rb +8 -0
- data/lib/cuprum/cli/rspec/deferred/dependencies/file_system_examples.rb +1469 -0
- data/lib/cuprum/cli/rspec/deferred/dependencies.rb +8 -0
- data/lib/cuprum/cli/rspec/deferred/metadata_examples.rb +856 -0
- data/lib/cuprum/cli/rspec/deferred/options_examples.rb +234 -0
- data/lib/cuprum/cli/rspec/deferred/registry_examples.rb +451 -0
- data/lib/cuprum/cli/rspec/deferred.rb +8 -0
- data/lib/cuprum/cli/rspec.rb +8 -0
- data/lib/cuprum/cli/version.rb +59 -0
- data/lib/cuprum/cli.rb +47 -0
- metadata +173 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cuprum
|
|
4
|
+
module Cli
|
|
5
|
+
# @api private
|
|
6
|
+
#
|
|
7
|
+
# The current version of the gem.
|
|
8
|
+
#
|
|
9
|
+
# @see http://semver.org/
|
|
10
|
+
module Version
|
|
11
|
+
# Major version.
|
|
12
|
+
MAJOR = 0
|
|
13
|
+
# Minor version.
|
|
14
|
+
MINOR = 1
|
|
15
|
+
# Patch version.
|
|
16
|
+
PATCH = 0
|
|
17
|
+
# Prerelease version.
|
|
18
|
+
PRERELEASE = nil
|
|
19
|
+
# Build metadata.
|
|
20
|
+
BUILD = nil
|
|
21
|
+
|
|
22
|
+
class << self
|
|
23
|
+
# Generates the gem version string from the Version constants.
|
|
24
|
+
#
|
|
25
|
+
# Inlined here because dependencies may not be loaded when processing a
|
|
26
|
+
# gemspec, which results in the user being unable to install the gem for
|
|
27
|
+
# the first time.
|
|
28
|
+
#
|
|
29
|
+
# @see SleepingKingStudios::Tools::SemanticVersion#to_gem_version
|
|
30
|
+
def to_gem_version
|
|
31
|
+
str = "#{MAJOR}.#{MINOR}.#{PATCH}"
|
|
32
|
+
|
|
33
|
+
prerelease = value_of(:PRERELEASE)
|
|
34
|
+
str << ".#{prerelease}" if prerelease
|
|
35
|
+
|
|
36
|
+
build = value_of(:BUILD)
|
|
37
|
+
str << ".#{build}" if build
|
|
38
|
+
|
|
39
|
+
str
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
private
|
|
43
|
+
|
|
44
|
+
def value_of(constant)
|
|
45
|
+
return nil unless const_defined?(constant)
|
|
46
|
+
|
|
47
|
+
value = const_get(constant)
|
|
48
|
+
|
|
49
|
+
return nil if value.respond_to?(:empty?) && value.empty?
|
|
50
|
+
|
|
51
|
+
value
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# @return [String] the current version of the gem.
|
|
57
|
+
VERSION = Version.to_gem_version
|
|
58
|
+
end
|
|
59
|
+
end
|
data/lib/cuprum/cli.rb
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'cuprum'
|
|
4
|
+
require 'sleeping_king_studios/tools'
|
|
5
|
+
|
|
6
|
+
require_relative 'cli/version'
|
|
7
|
+
|
|
8
|
+
# Toolkit for implementing business logic as function objects.
|
|
9
|
+
module Cuprum
|
|
10
|
+
# Command-line utility powered by Cuprum.
|
|
11
|
+
module Cli
|
|
12
|
+
autoload :Argument, 'cuprum/cli/argument'
|
|
13
|
+
autoload :Arguments, 'cuprum/cli/arguments'
|
|
14
|
+
autoload :Coercion, 'cuprum/cli/coercion'
|
|
15
|
+
autoload :Command, 'cuprum/cli/command'
|
|
16
|
+
autoload :Commands, 'cuprum/cli/commands'
|
|
17
|
+
autoload :Dependencies, 'cuprum/cli/dependencies'
|
|
18
|
+
autoload :Errors, 'cuprum/cli/errors'
|
|
19
|
+
autoload :Metadata, 'cuprum/cli/metadata'
|
|
20
|
+
autoload :Option, 'cuprum/cli/option'
|
|
21
|
+
autoload :Options, 'cuprum/cli/options'
|
|
22
|
+
autoload :Registry, 'cuprum/cli/registry'
|
|
23
|
+
|
|
24
|
+
@initializer = SleepingKingStudios::Tools::Toolbox::Initializer.new do
|
|
25
|
+
SleepingKingStudios::Tools.initializer.call
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# @return [String] the absolute path to the gem directory.
|
|
29
|
+
def self.gem_path
|
|
30
|
+
sep = File::SEPARATOR
|
|
31
|
+
pattern = /#{sep}lib#{sep}cuprum#{sep}?\z/
|
|
32
|
+
|
|
33
|
+
__dir__.sub(pattern, '')
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# @return [SleepingKingStudios::Tools::Toolbox::Initializer] the initializer
|
|
37
|
+
# for the module.
|
|
38
|
+
def self.initializer
|
|
39
|
+
@initializer
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# @return [String] the current version of the gem.
|
|
43
|
+
def self.version
|
|
44
|
+
Cuprum::Cli::VERSION
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: cuprum-cli
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Rob "Merlin" Smith
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: cuprum
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '1.3'
|
|
19
|
+
- - ">="
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 1.3.1
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
requirements:
|
|
26
|
+
- - "~>"
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: '1.3'
|
|
29
|
+
- - ">="
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: 1.3.1
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: herb
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - "~>"
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: 0.9.7
|
|
39
|
+
type: :runtime
|
|
40
|
+
prerelease: false
|
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
+
requirements:
|
|
43
|
+
- - "~>"
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: 0.9.7
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: plumbum
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - "~>"
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '0.1'
|
|
53
|
+
type: :runtime
|
|
54
|
+
prerelease: false
|
|
55
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - "~>"
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0.1'
|
|
60
|
+
- !ruby/object:Gem::Dependency
|
|
61
|
+
name: sleeping_king_studios-tools
|
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
|
63
|
+
requirements:
|
|
64
|
+
- - "~>"
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: '1.3'
|
|
67
|
+
type: :runtime
|
|
68
|
+
prerelease: false
|
|
69
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
70
|
+
requirements:
|
|
71
|
+
- - "~>"
|
|
72
|
+
- !ruby/object:Gem::Version
|
|
73
|
+
version: '1.3'
|
|
74
|
+
description: Provides tools and utilities for defining command-line tools.
|
|
75
|
+
email:
|
|
76
|
+
- sleepingkingstudios@gmail.com
|
|
77
|
+
executables: []
|
|
78
|
+
extensions: []
|
|
79
|
+
extra_rdoc_files: []
|
|
80
|
+
files:
|
|
81
|
+
- CHANGELOG.md
|
|
82
|
+
- CODE_OF_CONDUCT.md
|
|
83
|
+
- LICENSE
|
|
84
|
+
- README.md
|
|
85
|
+
- lib/cuprum/cli.rb
|
|
86
|
+
- lib/cuprum/cli/argument.rb
|
|
87
|
+
- lib/cuprum/cli/arguments.rb
|
|
88
|
+
- lib/cuprum/cli/arguments/class_methods.rb
|
|
89
|
+
- lib/cuprum/cli/coercion.rb
|
|
90
|
+
- lib/cuprum/cli/command.rb
|
|
91
|
+
- lib/cuprum/cli/commands.rb
|
|
92
|
+
- lib/cuprum/cli/commands/ci.rb
|
|
93
|
+
- lib/cuprum/cli/commands/ci/report.rb
|
|
94
|
+
- lib/cuprum/cli/commands/ci/rspec_command.rb
|
|
95
|
+
- lib/cuprum/cli/commands/ci/rspec_each_command.rb
|
|
96
|
+
- lib/cuprum/cli/commands/echo_command.rb
|
|
97
|
+
- lib/cuprum/cli/commands/file.rb
|
|
98
|
+
- lib/cuprum/cli/commands/file/generate_file.rb
|
|
99
|
+
- lib/cuprum/cli/commands/file/new_command.rb
|
|
100
|
+
- lib/cuprum/cli/commands/file/render_erb.rb
|
|
101
|
+
- lib/cuprum/cli/commands/file/resolve_template.rb
|
|
102
|
+
- lib/cuprum/cli/commands/file/templates.rb
|
|
103
|
+
- lib/cuprum/cli/commands/file/templates/rspec.rb.erb
|
|
104
|
+
- lib/cuprum/cli/commands/file/templates/ruby.rb.erb
|
|
105
|
+
- lib/cuprum/cli/dependencies.rb
|
|
106
|
+
- lib/cuprum/cli/dependencies/file_system.rb
|
|
107
|
+
- lib/cuprum/cli/dependencies/file_system/mock.rb
|
|
108
|
+
- lib/cuprum/cli/dependencies/standard_io.rb
|
|
109
|
+
- lib/cuprum/cli/dependencies/standard_io/helpers.rb
|
|
110
|
+
- lib/cuprum/cli/dependencies/standard_io/mock.rb
|
|
111
|
+
- lib/cuprum/cli/dependencies/system_command.rb
|
|
112
|
+
- lib/cuprum/cli/dependencies/system_command/mock.rb
|
|
113
|
+
- lib/cuprum/cli/errors.rb
|
|
114
|
+
- lib/cuprum/cli/errors/files.rb
|
|
115
|
+
- lib/cuprum/cli/errors/files/file_not_writeable.rb
|
|
116
|
+
- lib/cuprum/cli/errors/files/missing_parameter.rb
|
|
117
|
+
- lib/cuprum/cli/errors/files/missing_template.rb
|
|
118
|
+
- lib/cuprum/cli/errors/files/template_error.rb
|
|
119
|
+
- lib/cuprum/cli/errors/files/template_not_resolved.rb
|
|
120
|
+
- lib/cuprum/cli/errors/system_command_failure.rb
|
|
121
|
+
- lib/cuprum/cli/integrations.rb
|
|
122
|
+
- lib/cuprum/cli/integrations/thor.rb
|
|
123
|
+
- lib/cuprum/cli/integrations/thor/arguments_parser.rb
|
|
124
|
+
- lib/cuprum/cli/integrations/thor/registry.rb
|
|
125
|
+
- lib/cuprum/cli/integrations/thor/task.rb
|
|
126
|
+
- lib/cuprum/cli/metadata.rb
|
|
127
|
+
- lib/cuprum/cli/option.rb
|
|
128
|
+
- lib/cuprum/cli/options.rb
|
|
129
|
+
- lib/cuprum/cli/options/class_methods.rb
|
|
130
|
+
- lib/cuprum/cli/options/quiet.rb
|
|
131
|
+
- lib/cuprum/cli/options/verbose.rb
|
|
132
|
+
- lib/cuprum/cli/registry.rb
|
|
133
|
+
- lib/cuprum/cli/rspec.rb
|
|
134
|
+
- lib/cuprum/cli/rspec/deferred.rb
|
|
135
|
+
- lib/cuprum/cli/rspec/deferred/arguments_examples.rb
|
|
136
|
+
- lib/cuprum/cli/rspec/deferred/ci.rb
|
|
137
|
+
- lib/cuprum/cli/rspec/deferred/ci/report_examples.rb
|
|
138
|
+
- lib/cuprum/cli/rspec/deferred/dependencies.rb
|
|
139
|
+
- lib/cuprum/cli/rspec/deferred/dependencies/file_system_examples.rb
|
|
140
|
+
- lib/cuprum/cli/rspec/deferred/metadata_examples.rb
|
|
141
|
+
- lib/cuprum/cli/rspec/deferred/options_examples.rb
|
|
142
|
+
- lib/cuprum/cli/rspec/deferred/registry_examples.rb
|
|
143
|
+
- lib/cuprum/cli/version.rb
|
|
144
|
+
homepage: http://sleepingkingstudios.com
|
|
145
|
+
licenses:
|
|
146
|
+
- MIT
|
|
147
|
+
metadata:
|
|
148
|
+
bug_tracker_uri: https://github.com/sleepingkingstudios/cuprum-cli/issues
|
|
149
|
+
changelog_uri: https://github.com/sleepingkingstudios/cuprum-cli/CHANGELOG.md
|
|
150
|
+
homepage_uri: http://sleepingkingstudios.com
|
|
151
|
+
source_code_uri: https://github.com/sleepingkingstudios/cuprum-cli
|
|
152
|
+
rubygems_mfa_required: 'true'
|
|
153
|
+
rdoc_options: []
|
|
154
|
+
require_paths:
|
|
155
|
+
- lib
|
|
156
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
157
|
+
requirements:
|
|
158
|
+
- - ">="
|
|
159
|
+
- !ruby/object:Gem::Version
|
|
160
|
+
version: '3.2'
|
|
161
|
+
- - "<"
|
|
162
|
+
- !ruby/object:Gem::Version
|
|
163
|
+
version: '5'
|
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
|
+
requirements:
|
|
166
|
+
- - ">="
|
|
167
|
+
- !ruby/object:Gem::Version
|
|
168
|
+
version: '0'
|
|
169
|
+
requirements: []
|
|
170
|
+
rubygems_version: 4.0.15
|
|
171
|
+
specification_version: 4
|
|
172
|
+
summary: A command-line utility powered by Cuprum.
|
|
173
|
+
test_files: []
|