yuyi 1.0.8 → 1.1.3
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 +4 -4
- data/.new +1 -1
- data/.ruby-version +1 -0
- data/Gemfile +7 -2
- data/Gemfile.lock +16 -21
- data/Guardfile +1 -1
- data/README.md +41 -24
- data/Rakefile +38 -0
- data/bin/yuyi +9 -1
- data/lib/yuyi/cli.rb +32 -363
- data/lib/yuyi/core.rb +4 -0
- data/lib/yuyi/dsl.rb +131 -0
- data/lib/yuyi/menu.rb +174 -166
- data/lib/yuyi/roll.rb +95 -140
- data/lib/yuyi/source.rb +4 -3
- data/lib/yuyi/ui.rb +103 -0
- data/lib/yuyi.rb +17 -2
- data/spec/fixtures/menu.yaml +3 -2
- data/spec/fixtures/menu2.yaml +5 -2
- data/spec/fixtures/roll_dir/{nested/foo_roll.rb → foo_roll.rb} +0 -0
- data/spec/fixtures/roll_dir/foo_roll_model.rb +2 -0
- data/spec/fixtures/roll_dir/nested/bar_roll.rb +1 -1
- data/spec/fixtures/roll_zip.zip +0 -0
- data/spec/lib/yuyi/cli_spec.rb +11 -310
- data/spec/lib/yuyi/core_spec.rb +1 -1
- data/spec/lib/yuyi/dsl_spec.rb +135 -0
- data/spec/lib/yuyi/menu_spec.rb +177 -117
- data/spec/lib/yuyi/roll_spec.rb +38 -227
- data/spec/lib/yuyi/source_spec.rb +6 -2
- data/spec/lib/yuyi/ui_spec.rb +36 -0
- data/spec/roll_validator.rb +51 -0
- data/spec/spec_helper.rb +2 -0
- data/yuyi_menu +8 -0
- metadata +36 -10
- data/bin/install +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61189d38930a4751227f7263bb31392ca1dc49bb
|
4
|
+
data.tar.gz: 845d20b8b264d2419b49492e5776d2f21d89b218
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22d0535a36c4840dc4520aec28c168d6b477825016d8d69fc9c7f7dd2f019ff3930094502c2fe80d4a4fda42b6b0916ed8a17dab7df6a2deadd7fcfa124b5a97
|
7
|
+
data.tar.gz: 93e68be3256c38a7ede30e21cb817c5cb1c9dbfc74c1f02f35942a19bcd32a576e1e925490349728bee7ec705e1a713d35e17f0f4b4795b06328575e64968ef1
|
data/.new
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.1.2
|
data/Gemfile
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
|
-
gem '
|
2
|
+
gem 'thor'
|
3
3
|
|
4
4
|
group :development do
|
5
|
-
gem 'new'
|
6
5
|
gem 'guard'
|
7
6
|
gem 'guard-rspec', :require => false
|
7
|
+
gem 'new'
|
8
|
+
gem 'rake'
|
8
9
|
gem 'terminal-notifier-guard'
|
9
10
|
end
|
11
|
+
|
12
|
+
group :test do
|
13
|
+
gem 'rspec'
|
14
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activesupport (
|
5
|
-
i18n (~> 0.6, >= 0.6.
|
6
|
-
|
7
|
-
minitest (~> 5.1)
|
8
|
-
thread_safe (~> 0.1)
|
9
|
-
tzinfo (~> 1.1)
|
4
|
+
activesupport (3.2.19)
|
5
|
+
i18n (~> 0.6, >= 0.6.4)
|
6
|
+
multi_json (~> 1.0)
|
10
7
|
celluloid (0.15.2)
|
11
8
|
timers (~> 1.1.0)
|
12
9
|
coderay (1.1.0)
|
@@ -23,17 +20,16 @@ GEM
|
|
23
20
|
guard-rspec (4.2.10)
|
24
21
|
guard (~> 2.1)
|
25
22
|
rspec (>= 2.14, < 4.0)
|
26
|
-
i18n (0.6.
|
27
|
-
|
28
|
-
listen (2.7.7)
|
23
|
+
i18n (0.6.11)
|
24
|
+
listen (2.7.9)
|
29
25
|
celluloid (>= 0.15.2)
|
30
26
|
rb-fsevent (>= 0.9.3)
|
31
27
|
rb-inotify (>= 0.9)
|
32
|
-
lumberjack (1.0.
|
28
|
+
lumberjack (1.0.9)
|
33
29
|
method_source (0.8.2)
|
34
|
-
|
35
|
-
new (0.0.
|
36
|
-
activesupport
|
30
|
+
multi_json (1.10.1)
|
31
|
+
new (0.0.10)
|
32
|
+
activesupport
|
37
33
|
colorize
|
38
34
|
rake
|
39
35
|
recursive-open-struct
|
@@ -47,27 +43,24 @@ GEM
|
|
47
43
|
rb-fsevent (0.9.4)
|
48
44
|
rb-inotify (0.9.5)
|
49
45
|
ffi (>= 0.5.0)
|
50
|
-
recursive-open-struct (0.
|
46
|
+
recursive-open-struct (0.5.0)
|
51
47
|
rspec (3.0.0)
|
52
48
|
rspec-core (~> 3.0.0)
|
53
49
|
rspec-expectations (~> 3.0.0)
|
54
50
|
rspec-mocks (~> 3.0.0)
|
55
|
-
rspec-core (3.0.
|
51
|
+
rspec-core (3.0.2)
|
56
52
|
rspec-support (~> 3.0.0)
|
57
|
-
rspec-expectations (3.0.
|
53
|
+
rspec-expectations (3.0.2)
|
58
54
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
55
|
rspec-support (~> 3.0.0)
|
60
|
-
rspec-mocks (3.0.
|
56
|
+
rspec-mocks (3.0.2)
|
61
57
|
rspec-support (~> 3.0.0)
|
62
|
-
rspec-support (3.0.
|
58
|
+
rspec-support (3.0.2)
|
63
59
|
semantic (1.3.0)
|
64
60
|
slop (3.5.0)
|
65
61
|
terminal-notifier-guard (1.5.3)
|
66
62
|
thor (0.19.1)
|
67
|
-
thread_safe (0.3.4)
|
68
63
|
timers (1.1.0)
|
69
|
-
tzinfo (1.2.1)
|
70
|
-
thread_safe (~> 0.1)
|
71
64
|
|
72
65
|
PLATFORMS
|
73
66
|
ruby
|
@@ -76,5 +69,7 @@ DEPENDENCIES
|
|
76
69
|
guard
|
77
70
|
guard-rspec
|
78
71
|
new
|
72
|
+
rake
|
79
73
|
rspec
|
80
74
|
terminal-notifier-guard
|
75
|
+
thor
|
data/Guardfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|

|
2
|
+
|
2
3
|
# Yuyi
|
3
|
-
|
4
|
+
Custom automation for installing/uninstalling/upgrading your local machine environment
|
4
5
|
|
5
6
|
###### Support
|
6
7
|
* Mac OS X
|
@@ -12,7 +13,14 @@ Nothing! Well thats not entirely true... the dependencies are already available
|
|
12
13
|
|
13
14
|
#### Quick Usage
|
14
15
|
* Create a `yuyi_menu` file in your home folder _(see below for examples)_
|
15
|
-
|
16
|
+
|
17
|
+
If you are running yuyi on a brand new machine, you will need to run sudo to install Yuyi to the system installed ruby
|
18
|
+
|
19
|
+
* `sudo gem install yuyi`
|
20
|
+
|
21
|
+
Other you can just install it normally...
|
22
|
+
|
23
|
+
* `gem install yuyi`
|
16
24
|
|
17
25
|
#### Example Menu
|
18
26
|
|
@@ -30,17 +38,27 @@ Make sure to include a colon (:) at the end of each roll name.
|
|
30
38
|
|
31
39
|
If a roll accepts arguments, indent the key/value pairs below the roll name. You will be prompted with roll options when Yuyi runs, and the opportunity to change them before anything is installed.
|
32
40
|
|
41
|
+
**Then just run `yuyi`**
|
42
|
+
|
33
43
|
### Development
|
44
|
+
Use yuyi to install development dependencies
|
34
45
|
|
35
|
-
|
36
|
-
|
37
|
-
* bundler
|
46
|
+
`yuyi https://raw.githubusercontent.com/brewster1134/Yuyi/master/yuyi_menu`
|
47
|
+
`bundle install`
|
38
48
|
|
39
49
|
##### Running Tests
|
40
|
-
Run tests using rspec through guard
|
41
|
-
|
42
50
|
```sh
|
43
|
-
|
51
|
+
// run guard to watch the source files and automatically run tests when you make changes
|
52
|
+
bundle exec rake yuyi
|
53
|
+
|
54
|
+
// run rspec tests on the yuyi library
|
55
|
+
bundle exec rake yuyi:test
|
56
|
+
|
57
|
+
// run rspec tests on the rolls specified in a given menu
|
58
|
+
bundle exec rake yuyi:test:rolls
|
59
|
+
|
60
|
+
// run rspec tests on the library and the rolld
|
61
|
+
bundle exec rake yuyi:test:all
|
44
62
|
```
|
45
63
|
|
46
64
|
##### Writing Rolls
|
@@ -67,7 +85,19 @@ bundle exec guard
|
|
67
85
|
|
68
86
|
```ruby
|
69
87
|
class MyRoll < Yuyi::Roll
|
88
|
+
options({
|
89
|
+
:version => {
|
90
|
+
:description => 'The specific version you would like to install',
|
91
|
+
:example => '1.0', # optional
|
92
|
+
:default => '2.0', # optional
|
93
|
+
:required => true # optional - shows option in red
|
94
|
+
}
|
95
|
+
})
|
96
|
+
|
97
|
+
dependencies :homebrew, :foo
|
98
|
+
|
70
99
|
install do
|
100
|
+
dependencies :hombrew_cask if options[:version] == '2.0' # add dependencies conditionally
|
71
101
|
run 'brew install my_roll', :verbose => true
|
72
102
|
|
73
103
|
write_to_file '~/.bash_profile', "# #{title}"
|
@@ -88,31 +118,18 @@ class MyRoll < Yuyi::Roll
|
|
88
118
|
command? 'brew'
|
89
119
|
|
90
120
|
# or check the output of a command
|
91
|
-
|
92
|
-
`brew list` =~ /myroll/
|
121
|
+
run('brew list') =~ /myroll/
|
93
122
|
end
|
94
|
-
|
95
|
-
dependencies :homebrew, :foo
|
96
|
-
dependencies :hombrew_cask if options[:version] == '2.0' # add dependencies conditionally
|
97
|
-
|
98
|
-
options(
|
99
|
-
:version => {
|
100
|
-
:description => 'The specific version you would like to install',
|
101
|
-
:example => '1.0', # optional
|
102
|
-
:default => '2.0', # optional
|
103
|
-
:required => true # optional - shows option in red
|
104
|
-
}
|
105
|
-
)
|
106
123
|
end
|
107
124
|
```
|
108
125
|
|
109
126
|
### TODO
|
127
|
+
* progressbar
|
110
128
|
* vagrant plugins
|
111
129
|
* Enforce required options
|
112
130
|
* New roll generator (use new!)
|
113
|
-
* DOCS!
|
114
131
|
* show roll options on -l
|
115
|
-
* home brew/home brew cask roll to inherit
|
116
132
|
* installation summary
|
133
|
+
* DOCS!
|
117
134
|
|
118
135
|
[.](http://www.comedycentral.com/video-clips/3myds9/upright-citizens-brigade-sushi-chef)
|
data/Rakefile
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
namespace :yuyi do
|
2
|
+
desc 'Watch Yuyi for changes with guard'
|
3
|
+
task(:watch) do
|
4
|
+
require 'guard'
|
5
|
+
Guard.start
|
6
|
+
while Guard.running do
|
7
|
+
sleep 0.5
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
namespace :test do
|
12
|
+
require 'rspec/core/rake_task'
|
13
|
+
|
14
|
+
desc 'Run the rspec tests for the Yuyi library and a sanity check on rolls from a menu source'
|
15
|
+
task :all => ['test:library', 'test:rolls']
|
16
|
+
|
17
|
+
task :library do
|
18
|
+
RSpec::Core::RakeTask.new(:spec)
|
19
|
+
Rake::Task[:spec].invoke
|
20
|
+
end
|
21
|
+
|
22
|
+
desc 'Run a sanity check on the source rolls'
|
23
|
+
task :rolls do
|
24
|
+
RSpec::Core::RakeTask.new(:roll_validator) do |t|
|
25
|
+
t.pattern = './spec/roll_validator.rb'
|
26
|
+
end
|
27
|
+
Rake::Task[:roll_validator].invoke
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
desc 'Run the rspec tests for the Yuyi library'
|
32
|
+
task :test => 'test:library'
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
desc 'Alias for yuyi:watch'
|
37
|
+
task :yuyi => 'yuyi:watch'
|
38
|
+
task :default => 'yuyi:watch'
|
data/bin/yuyi
CHANGED
@@ -3,4 +3,12 @@ $: << File.dirname(__FILE__) + '/../lib'
|
|
3
3
|
|
4
4
|
require 'yuyi'
|
5
5
|
|
6
|
-
|
6
|
+
# skip thor if no arguments are passed, or if using ruby 1.8.x
|
7
|
+
if ARGV.empty? || RUBY_VERSION.match(/^1.8/)
|
8
|
+
Yuyi.start
|
9
|
+
|
10
|
+
# handle arguments with thor
|
11
|
+
else
|
12
|
+
require 'yuyi/cli'
|
13
|
+
Yuyi::Cli.start ARGV
|
14
|
+
end
|