proteus-kits 0.3 → 0.4
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/.gitignore +1 -0
- data/LICENSE.md +1 -1
- data/README.md +2 -2
- data/lib/proteus.rb +1 -0
- data/lib/proteus/kit.rb +44 -19
- data/lib/proteus/repos.rb +13 -0
- data/lib/proteus/version.rb +1 -1
- data/proteus-kits.gemspec +2 -2
- data/spec/proteus_spec.rb +33 -5
- data/spec/spec_helper.rb +22 -0
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5b2e2b05d53b5e9234c487cbfdac300f8a7ea99
|
4
|
+
data.tar.gz: 4d78aea43cb836ad8d775cc9093497403af3276e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 019a7d3065cb24ca4cd7b67241f22ebf9f6cb0aaf15ec591c944e4cac47591ab485e5c833248a5493dbf641b9e17bd3535eb57b6a2107c37c4f9cae78c69235e
|
7
|
+
data.tar.gz: 7b541b78c175d2ec022f393f87c59e197e288b7edfe46f10cc8d345da2209a53a58aa8712c19c9ba93d3dd5a22fc1b70f8aa40315d4b9da3f6e9319d86fa1270
|
data/.gitignore
CHANGED
data/LICENSE.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright © 2014–
|
3
|
+
Copyright © 2014–2016 [thoughtbot, inc.](http://thoughtbot.com)
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the “Software”), to deal
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ and includes our favorite front-end development tools.
|
|
8
8
|
|
9
9
|
* [Middleman](http://github.com/thoughtbot/proteus-middleman)
|
10
10
|
* [Jekyll](http://github.com/thoughtbot/proteus-jekyll)
|
11
|
-
*
|
11
|
+
* Have a request for another kit? Open an issue to let us know.
|
12
12
|
|
13
13
|
## Installation
|
14
14
|
|
@@ -69,4 +69,4 @@ Proteus is maintained and funded by [thoughtbot, inc](http://thoughtbot.com). Th
|
|
69
69
|
|
70
70
|
## License
|
71
71
|
|
72
|
-
Copyright © 2014–
|
72
|
+
Copyright © 2014–2016 [thoughtbot, inc](http://thoughtbot.com). Proteus is free software, and may be redistributed under the terms specified in the [license](LICENSE.md).
|
data/lib/proteus.rb
CHANGED
data/lib/proteus/kit.rb
CHANGED
@@ -1,32 +1,56 @@
|
|
1
1
|
require "proteus/version"
|
2
|
+
require "proteus/repos"
|
2
3
|
require "thor"
|
3
4
|
|
4
5
|
module Proteus
|
5
6
|
class Kit < Thor
|
6
7
|
include Thor::Actions
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
no_commands do
|
10
|
+
def url(id)
|
11
|
+
kit = Proteus::REPOS[id.to_sym]
|
12
|
+
kit[:url]
|
13
|
+
end
|
14
|
+
|
15
|
+
def name(id)
|
16
|
+
kit = Proteus::REPOS[id.to_sym]
|
17
|
+
kit[:name]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "list", "shows a list of available kits"
|
22
|
+
def list
|
23
|
+
repos = Proteus::REPOS
|
24
|
+
repos.each do |id, repo|
|
25
|
+
puts "#{id} - #{repo[:name]}"
|
26
|
+
end
|
11
27
|
end
|
12
28
|
|
13
29
|
desc "new", "runs the command to clone a particular kit"
|
14
|
-
def new(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
30
|
+
def new(id, dir = nil)
|
31
|
+
dir ||= id
|
32
|
+
kit = Proteus::REPOS[id.to_sym]
|
33
|
+
|
34
|
+
if kit
|
35
|
+
name = kit[:name]
|
36
|
+
url = kit[:url]
|
37
|
+
|
38
|
+
if system "git ls-remote #{url} #{dir} > /dev/null 2>&1"
|
39
|
+
puts "Starting a new #{name} project in #{dir} from #{url}"
|
40
|
+
system %{
|
41
|
+
git clone "#{url}" "#{dir}" &&
|
42
|
+
cd "#{dir}" &&
|
43
|
+
rm -rf .git &&
|
44
|
+
git init &&
|
45
|
+
git add . &&
|
46
|
+
git commit -m 'New #{name} project' &&
|
47
|
+
cd -
|
48
|
+
}
|
49
|
+
else
|
50
|
+
puts "Can't find a repo at #{url}."
|
51
|
+
end
|
28
52
|
else
|
29
|
-
puts "
|
53
|
+
puts "Kit not found. Run `proteus list` to see available kits."
|
30
54
|
end
|
31
55
|
end
|
32
56
|
|
@@ -50,7 +74,8 @@ module Proteus
|
|
50
74
|
|
51
75
|
desc "version", "Show Proteus version"
|
52
76
|
def version
|
53
|
-
|
77
|
+
version_number = Proteus::VERSION
|
78
|
+
puts "Proteus #{version_number}"
|
54
79
|
end
|
55
80
|
end
|
56
81
|
end
|
data/lib/proteus/version.rb
CHANGED
data/proteus-kits.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.7"
|
22
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
-
spec.add_development_dependency "rspec", "~>
|
23
|
+
spec.add_development_dependency "rspec", "~> 3.3"
|
24
24
|
|
25
|
-
spec.add_dependency "thor"
|
25
|
+
spec.add_dependency "thor", "~> 0.19"
|
26
26
|
end
|
data/spec/proteus_spec.rb
CHANGED
@@ -2,15 +2,43 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Proteus do
|
4
4
|
before do
|
5
|
+
remove_dummy_repo
|
5
6
|
@proteus = Proteus::Kit.new
|
7
|
+
@repos = Proteus::REPOS
|
6
8
|
end
|
7
9
|
|
8
|
-
it "
|
9
|
-
|
10
|
-
expect(url).to eq("git@github.com:thoughtbot/proteus-test.git")
|
10
|
+
it "has a list of repos" do
|
11
|
+
expect(@repos).not_to be_nil
|
11
12
|
end
|
12
13
|
|
13
|
-
it "
|
14
|
-
expect(@
|
14
|
+
it "gets repos in the list" do
|
15
|
+
expect(@repos.size).to be > 0
|
16
|
+
end
|
17
|
+
|
18
|
+
it "gets the kit name" do
|
19
|
+
expect(@proteus.name("jekyll")).to eq("Jekyll Starter")
|
20
|
+
end
|
21
|
+
|
22
|
+
it "gets the Git url" do
|
23
|
+
url = "https://github.com/thoughtbot/proteus-middleman.git"
|
24
|
+
expect(@proteus.url("middleman")).to eq(url)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "displays a list of repos" do
|
28
|
+
expect { @proteus.list }.to output().to_stdout
|
29
|
+
end
|
30
|
+
|
31
|
+
it "displays a friendly message if the kit isn't in the list" do
|
32
|
+
message = "Kit not found. Run `proteus list` to see available kits.\n"
|
33
|
+
expect { @proteus.new("invalid") }.to output(message).to_stdout
|
34
|
+
end
|
35
|
+
|
36
|
+
it "displays the current version" do
|
37
|
+
version = Proteus::VERSION
|
38
|
+
expect { @proteus.version }.to output("Proteus #{version}\n").to_stdout
|
39
|
+
end
|
40
|
+
|
41
|
+
def remove_dummy_repo
|
42
|
+
FileUtils.rm_rf(Dir["./spec/dummy"])
|
15
43
|
end
|
16
44
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,25 @@
|
|
1
1
|
$LOAD_PATH << File.join('../lib')
|
2
2
|
|
3
3
|
require 'proteus'
|
4
|
+
|
5
|
+
def quietly
|
6
|
+
streams = STDOUT, STDERR
|
7
|
+
on_hold = streams.collect { |stream| stream.dup }
|
8
|
+
streams.each do |stream|
|
9
|
+
stream.reopen(null_stream)
|
10
|
+
stream.sync = true
|
11
|
+
end
|
12
|
+
yield
|
13
|
+
ensure
|
14
|
+
streams.each_with_index do |stream, i|
|
15
|
+
stream.reopen(on_hold[i])
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def null_stream
|
20
|
+
if RUBY_PLATFORM =~ /mswin/
|
21
|
+
'NUL:'
|
22
|
+
else
|
23
|
+
'/dev/null'
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proteus-kits
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Ogle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,28 +44,28 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '3.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '3.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: thor
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '0.19'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '0.19'
|
69
69
|
description: A collection of useful starter kits to help you prototype faster
|
70
70
|
email:
|
71
71
|
- support@thoughtbot.com
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- bin/proteus
|
84
84
|
- lib/proteus.rb
|
85
85
|
- lib/proteus/kit.rb
|
86
|
+
- lib/proteus/repos.rb
|
86
87
|
- lib/proteus/version.rb
|
87
88
|
- proteus-kits.gemspec
|
88
89
|
- spec/proteus_spec.rb
|
@@ -107,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
108
|
version: '0'
|
108
109
|
requirements: []
|
109
110
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.4.
|
111
|
+
rubygems_version: 2.4.5.1
|
111
112
|
signing_key:
|
112
113
|
specification_version: 4
|
113
114
|
summary: Starter kits to help you prototype faster
|