clenver 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -1
- data/bin/clenver +2 -67
- data/clenver.gemspec +1 -0
- data/features/clenver_init.feature +4 -2
- data/features/clenver_version.feature +11 -0
- data/features/step_definitions/clenver_steps.rb +6 -0
- data/lib/clenver.rb +2 -2
- data/lib/clenver/cli.rb +43 -0
- data/lib/clenver/version.rb +1 -1
- data/test/vbox/regression.sh +1 -1
- metadata +17 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e85aeffdfd4c41bcd5e0619efd95f1a01376b88
|
4
|
+
data.tar.gz: b653a128a39b2df1fe746bfb0cfc9264f824edf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e17ec53f716c370021a4dedef70d670d52bb4584827e0c94ea140747ca85acd1c77751d6bc6860ef9f54fcb2f82a62454138fa074b7401bb95ada298f6d74abe
|
7
|
+
data.tar.gz: bbb1da9489a957ba1d706a04cb5d622cd0c73a3ebb51e48195bf893897b19bf2b50d233a533e7bbec753aa5f057fe49a001e3a8106294a3ec393dff421da6b2e
|
data/Gemfile.lock
CHANGED
data/bin/clenver
CHANGED
@@ -1,68 +1,3 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require '
|
3
|
-
|
4
|
-
require 'clenver'
|
5
|
-
require 'clenver/runner'
|
6
|
-
require 'clenver/logging'
|
7
|
-
rescue LoadError
|
8
|
-
STDERR.puts "In development, you need to use `bundle exec bin/clenver` to run your app"
|
9
|
-
STDERR.puts "At install-time, RubyGems will make sure lib, etc. are in the load path"
|
10
|
-
STDERR.puts "Feel free to remove this message from bin/clenver now"
|
11
|
-
exit 64
|
12
|
-
end
|
13
|
-
|
14
|
-
include GLI::App
|
15
|
-
|
16
|
-
program_desc 'Command Line home ENVironment managER'
|
17
|
-
|
18
|
-
version Clenver::VERSION
|
19
|
-
|
20
|
-
desc 'Initialize workspace environment based on given configuration'
|
21
|
-
arg_name 'Describe arguments to init here'
|
22
|
-
command :init do |c|
|
23
|
-
# c.desc 'Describe a switch to init'
|
24
|
-
# c.switch :s
|
25
|
-
|
26
|
-
# c.desc 'Describe a flag to init'
|
27
|
-
# c.default_value 'default'
|
28
|
-
# c.flag :f
|
29
|
-
c.action do |global_options,options,args|
|
30
|
-
|
31
|
-
# Your command logic here
|
32
|
-
|
33
|
-
unless args.empty?
|
34
|
-
include Logging
|
35
|
-
logger.debug("args: #{args}")
|
36
|
-
path = args[0]
|
37
|
-
dst_dist = args[1]
|
38
|
-
Clenver::Runner.new(path, dst_dist).start
|
39
|
-
else
|
40
|
-
exit_now!("pass config file as a clenver init argument", 2)
|
41
|
-
end
|
42
|
-
# If you have any errors, just raise them
|
43
|
-
# raise "that command made no sense"
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
pre do |global,command,options,args|
|
48
|
-
# Pre logic here
|
49
|
-
# Return true to proceed; false to abort and not call the
|
50
|
-
# chosen command
|
51
|
-
# Use skips_pre before a command to skip this block
|
52
|
-
# on that command only
|
53
|
-
true
|
54
|
-
end
|
55
|
-
|
56
|
-
post do |global,command,options,args|
|
57
|
-
# Post logic here
|
58
|
-
# Use skips_post before a command to skip this
|
59
|
-
# block on that command only
|
60
|
-
end
|
61
|
-
|
62
|
-
on_error do |exception|
|
63
|
-
# Error logic here
|
64
|
-
# return false to skip default error handling
|
65
|
-
true
|
66
|
-
end
|
67
|
-
|
68
|
-
exit run(ARGV)
|
2
|
+
require 'clenver/cli'
|
3
|
+
Clenver::CLI.start
|
data/clenver.gemspec
CHANGED
@@ -25,5 +25,6 @@ spec = Gem::Specification.new do |s|
|
|
25
25
|
s.add_development_dependency('aruba')
|
26
26
|
s.add_development_dependency('rspec-expectations')
|
27
27
|
s.add_runtime_dependency('gli','2.8.0')
|
28
|
+
s.add_runtime_dependency('thor','0.18.1')
|
28
29
|
s.add_runtime_dependency('git','1.2.6')
|
29
30
|
end
|
@@ -147,6 +147,7 @@ Feature: Initialization
|
|
147
147
|
When I run `clenver init test_repo.yml some_tmp`
|
148
148
|
Then the output should contain "success!!!!\n"
|
149
149
|
|
150
|
+
@ignore
|
150
151
|
Scenario: apt: check if package installed
|
151
152
|
Given The default aruba timeout is 10 seconds
|
152
153
|
Given a file named "test_repo.yml" with:
|
@@ -157,6 +158,7 @@ Feature: Initialization
|
|
157
158
|
When I run `clenver init test_repo.yml some_tmp`
|
158
159
|
Then the output should contain "vim is already the newest version.\n"
|
159
160
|
|
161
|
+
@ignore
|
160
162
|
Scenario: package installed and simple command run
|
161
163
|
Given The default aruba timeout is 10 seconds
|
162
164
|
Given a file named "test_repo.yml" with:
|
@@ -172,7 +174,7 @@ Feature: Initialization
|
|
172
174
|
Then the output should contain "success!!!!\n"
|
173
175
|
|
174
176
|
Scenario: install gem
|
175
|
-
Given The default aruba timeout is
|
177
|
+
Given The default aruba timeout is 120 seconds
|
176
178
|
Given a file named "test_repo.yml" with:
|
177
179
|
"""
|
178
180
|
gem:
|
@@ -185,7 +187,7 @@ Feature: Initialization
|
|
185
187
|
Then the output should contain "installed\n"
|
186
188
|
Then the output should contain "success!!!!\n"
|
187
189
|
|
188
|
-
@
|
190
|
+
@ignore
|
189
191
|
Scenario: install gems and packages
|
190
192
|
Given The default aruba timeout is 120 seconds
|
191
193
|
Given a file named "test_repo.yml" with:
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Feature: Clenver return its version
|
2
|
+
In order to improve error reports from users
|
3
|
+
Application should return correct version
|
4
|
+
|
5
|
+
Scenario: Exit correctly when asked about version
|
6
|
+
When I run `clenver version`
|
7
|
+
Then the exit status should be 0
|
8
|
+
|
9
|
+
Scenario: Return correct version number
|
10
|
+
When I run `clenver version`
|
11
|
+
Then the output should contain correct version
|
@@ -28,3 +28,9 @@ Then(/^the following remote (?:uris|branches) should be connected in "(.*?)":$/)
|
|
28
28
|
res.to_i.should eq(2)
|
29
29
|
end
|
30
30
|
end
|
31
|
+
|
32
|
+
Then(/^the output should contain correct version$/) do
|
33
|
+
require 'clenver/version'
|
34
|
+
assert_partial_output(Clenver::VERSION, all_output)
|
35
|
+
end
|
36
|
+
|
data/lib/clenver.rb
CHANGED
data/lib/clenver/cli.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'clenver'
|
2
|
+
require 'clenver/runner'
|
3
|
+
require 'clenver/logging'
|
4
|
+
require 'thor'
|
5
|
+
require 'thor/actions'
|
6
|
+
|
7
|
+
module Clenver
|
8
|
+
class CLI < Thor
|
9
|
+
include Thor::Actions
|
10
|
+
include Logging
|
11
|
+
def self.start(*)
|
12
|
+
super
|
13
|
+
# logger.debug("args: #{args}")
|
14
|
+
# path = args[0]
|
15
|
+
# dst_dist = args[1]
|
16
|
+
# Clenver::Runner.new(path, dst_dist).start
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize(*)
|
20
|
+
super
|
21
|
+
end
|
22
|
+
|
23
|
+
default_task :help
|
24
|
+
|
25
|
+
def help(cli = nil)
|
26
|
+
logger.error("Not implemented")
|
27
|
+
end
|
28
|
+
|
29
|
+
desc "init [FILE]", "initialize $HOME directory according to instructions in FILE"
|
30
|
+
def init(config, dst = nil)
|
31
|
+
if File.exist?(config)
|
32
|
+
Clenver::Runner.new(config, dst).start
|
33
|
+
else
|
34
|
+
exit 2
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "version", "Prints the clenver's version information"
|
39
|
+
def version
|
40
|
+
logger.info("Clenver version #{Clenver::VERSION}")
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/clenver/version.rb
CHANGED
data/test/vbox/regression.sh
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clenver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Król
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 2.8.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: thor
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.18.1
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.18.1
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: git
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,10 +132,12 @@ files:
|
|
118
132
|
- clenver.rdoc
|
119
133
|
- features/clenver.feature
|
120
134
|
- features/clenver_init.feature
|
135
|
+
- features/clenver_version.feature
|
121
136
|
- features/step_definitions/clenver_steps.rb
|
122
137
|
- features/support/env.rb
|
123
138
|
- lib/clenver.rb
|
124
139
|
- lib/clenver/assets/sample.yml
|
140
|
+
- lib/clenver/cli.rb
|
125
141
|
- lib/clenver/link.rb
|
126
142
|
- lib/clenver/logging.rb
|
127
143
|
- lib/clenver/package_manager.rb
|