xcbootstrap 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9cadf1395ad4feaff3ba092976f74a6bc707bab2
4
- data.tar.gz: 8279a801f9cb127fc614e64fe4054c4dd64497b7
3
+ metadata.gz: 55316dd561cbf2d95df6f98509f0351fa0ccb59a
4
+ data.tar.gz: b7c0c160c9539ea8fef3f41c532458cca20c0cf3
5
5
  SHA512:
6
- metadata.gz: bc0bded42336d2f73c51a4ee8515a1a9662ce69a2a6eab8eaa1dee7bf017aa10286d1c148fc2e9d51aebca534e22443e52e33a2e67c9d56a72c24bf05d757b32
7
- data.tar.gz: da9c3596d4c034c1f46d42d201659993229fc94e6d1363ae440d4c362bedc304126c45bf6801b2a8287cd93a23225fe4bf6b6c89525c95f8be371e74c5ff1930
6
+ metadata.gz: 0ae0967008311f7d57e4e874766e17dde443641f91bafb3259f08a760c98fc3d3afd424b7b617fb1ff8194b1bf258910b35640dceb63c44ea79b10fe6cf3f0d7
7
+ data.tar.gz: 270c24012d640762a89320879ae4b2818fbd0d5a04c6d7d1358b4fb14351e6b472080272ae4bf7a87300f7dd0c408344ee987f46c85faadbd59fcf5244a555c0
@@ -5,4 +5,4 @@ $LOAD_PATH << File.expand_path("../lib", File.dirname(__FILE__))
5
5
  require 'rubygems'
6
6
  require 'xcbootstrap'
7
7
 
8
- XCBootstrap::Cli.run
8
+ XCBootstrap::Cli.start(ARGV)
@@ -8,8 +8,6 @@ module XCBootstrap
8
8
  attr_accessor :project_dir
9
9
 
10
10
  def initialize template_root, template_name, project_dir
11
- # FileUtils.mkdir_p project_dir
12
-
13
11
  @template_dir = File.join template_root, template_name
14
12
  raise "Invalid template: could not find template directory #{@template_dir}" unless File.directory?(@template_dir)
15
13
 
@@ -19,7 +17,7 @@ module XCBootstrap
19
17
  @manifest = YAML.load_file manifest_file
20
18
  raise "Invalid template: manifest file did not contain a hash of file mappings #{manifest_file}" unless manifest_data_is_valid(@manifest)
21
19
 
22
- @project_dir = File.expand_path(project_dir, Dir.getwd)
20
+ @project_dir = File.expand_path(project_dir, Dir.pwd)
23
21
  end
24
22
 
25
23
  def process
@@ -1,17 +1,41 @@
1
- require 'clamp'
1
+ require 'thor'
2
2
  require 'xcbootstrap/bootstrap'
3
+ require 'xcbootstrap/templates'
3
4
 
4
5
  module XCBootstrap
5
- class Cli < Clamp::Command
6
-
7
- option ["-t", "--template"], "T", "name of the template to use", :required => true
8
- option ["-p", "--project"], "P", "relative path to the desired project to create", :required => true
9
-
10
- def execute
11
- template_root = File.expand_path(File.join(File.dirname(__FILE__), "../../templates"))
12
- bootstrapper = XCBootstrap::Bootstrap.new(template_root, template, project)
13
- bootstrapper.process
14
- bootstrapper.finish
6
+
7
+ class Create < Thor
8
+
9
+ Templates.all_templates.each do |template_name|
10
+ desc template_name, "Create a project PROJECT_NAME based on the template '#{template_name}'"
11
+ define_method(template_name) do |project_name|
12
+ template_root = File.expand_path(File.join(File.dirname(__FILE__), "../../templates"))
13
+ bootstrapper = Bootstrap.new(template_root, template_name, project_name)
14
+ bootstrapper.process
15
+ bootstrapper.finish
16
+ end
17
+ end
18
+
19
+ end
20
+
21
+ class Cli < Thor
22
+
23
+ desc "list", "list available project templates"
24
+ def list
25
+ puts "Templates:"
26
+
27
+ Templates.all_templates.each do |template|
28
+ puts " #{template}"
29
+ end
30
+ end
31
+
32
+ desc "create", "Create a new project, in the current working directory, based on a specified template"
33
+ subcommand "create", Create
34
+
35
+ def self.exit_on_failure?
36
+ true
15
37
  end
38
+
16
39
  end
40
+
17
41
  end
@@ -18,7 +18,7 @@ module XCBootstrap
18
18
  def process
19
19
  FileUtils.mkdir_p File.dirname(to)
20
20
 
21
- if File.binary? from
21
+ if File.binary?(from) || File.image?(from)
22
22
  FileUtils.cp from, to
23
23
  else
24
24
  sed_copy from, to
@@ -0,0 +1,28 @@
1
+ require 'fileutils'
2
+
3
+ module XCBootstrap
4
+ class Templates
5
+
6
+ TEMPLATE_ROOT = File.expand_path(File.join(File.dirname(__FILE__), "../../templates"))
7
+
8
+ attr_accessor :template_name
9
+
10
+ def self.all_templates
11
+ Dir.glob("#{TEMPLATE_ROOT}/*").map do |template_path|
12
+ template_name = File.basename(template_path)
13
+ end
14
+ end
15
+
16
+ def initialize(template_name)
17
+ @template_name = template_name
18
+ end
19
+
20
+ def path
21
+ File.join(TEMPLATE_ROOT, template_name)
22
+ end
23
+
24
+ def manifest
25
+ File.join(path, "manifest.yml")
26
+ end
27
+ end
28
+ end
@@ -1,3 +1,3 @@
1
1
  module XCBootstrap
2
- VERSION = "0.0.3"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,57 +1,142 @@
1
- describe 'xcbootstrap for a sample project' do
1
+ require_relative '../spec_helper'
2
+
3
+ describe 'xcbootstrap' do
2
4
  before(:all) do
3
- @test_output_directory = File.join(File.dirname(__FILE__), '../../test_output')
4
- @bootstrap_output = File.join(@test_output_directory, '/Output')
5
5
  @xcbootstrap = File.expand_path(File.join(File.dirname(__FILE__), '../../bin/xcbootstrap'))
6
6
  end
7
7
 
8
- context 'with full option names' do
9
- before(:all) do
10
- FileUtils.rm_rf @test_output_directory
11
- @xcbootstrap_result = system("#{@xcbootstrap} --template Sample --project #{@bootstrap_output}")
8
+ context 'with no arguments' do
9
+ it 'should run successfully' do
10
+ status, _ = run_command("#{@xcbootstrap}")
11
+ status.should be_true
12
12
  end
13
13
 
14
- it 'should run successfully' do
15
- @xcbootstrap_result.should be_true
14
+ it 'should print usage information' do
15
+ _, output = run_command("#{@xcbootstrap}")
16
+
17
+ output.should include("Commands:")
18
+ output.should include("xcbootstrap help")
19
+ output.should include("xcbootstrap create")
20
+ output.should include("xcbootstrap list")
16
21
  end
22
+ end
17
23
 
18
- it 'should have created the output directory' do
19
- File.exists?(@bootstrap_output).should be_true
24
+ context 'when retrieving help on one of the available commands' do
25
+ it 'should have a help option' do
26
+ status, _ = run_command("#{@xcbootstrap} help")
27
+ status.should be_true
20
28
  end
21
-
22
- it 'should have created source and test directories' do
23
- File.directory?(File.join(@bootstrap_output, "Output")).should be_true
24
- File.directory?(File.join(@bootstrap_output, "OutputTests")).should be_true
29
+
30
+ it 'should print available help for that command' do
31
+ _, help_output = run_command("#{@xcbootstrap} help")
32
+ _, default_output = run_command("#{@xcbootstrap}")
33
+ help_output.should == default_output
25
34
  end
26
-
27
- it 'should have created all the project files' do
28
- output_files = Dir.glob("#{@bootstrap_output}/**/{.*,*}").select { |file| !File.directory?(file) }
29
- output_files.size.should == 13
35
+
36
+ it 'should have a help option for specific commands' do
37
+ status, _ = run_command("#{@xcbootstrap} help list")
38
+ status.should be_true
30
39
  end
31
-
32
- it 'should have the git ignore file renamed' do
33
- File.exists?(File.join(@bootstrap_output, ".gitignore")).should be_true
40
+
41
+ it 'should show usage information for a specific commands' do
42
+ _, output = run_command("#{@xcbootstrap} help list")
43
+
44
+ output.should include("Usage:")
45
+ output.should include("xcbootstrap list")
34
46
  end
47
+ end
35
48
 
36
- it 'should have replaced the template with the project name' do
37
- content = File.read(File.join(@bootstrap_output, "Output.xcodeproj/project.pbxproj"))
38
- content.should_not include("Sample")
39
- content.should include("Output")
49
+ context 'with the list argument' do
50
+ it 'should run successfully' do
51
+ status, _ = run_command("#{@xcbootstrap} list")
52
+ status.should be_true
40
53
  end
54
+
55
+ it 'should list all the available templates' do
56
+ _, output = run_command("#{@xcbootstrap} list")
57
+ output.should include("Templates:")
58
+ output.should include("Sample")
59
+ end
41
60
  end
42
61
 
43
- context 'with short option names' do
44
- before(:all) do
45
- FileUtils.rm_rf @test_output_directory
46
- @xcbootstrap_result = system("#{@xcbootstrap} -t Sample -p #{@bootstrap_output}")
62
+ context 'with the create argument' do
63
+ context 'with a valid template option specified' do
64
+ context 'without the project option' do
65
+ it 'should not run successfully' do
66
+ status, _ = run_command("#{@xcbootstrap} create simple")
67
+ status.should be_false
68
+ end
69
+ end
70
+
71
+ context 'with the project option' do
72
+ before(:all) do
73
+ @test_output_directory = File.join(File.dirname(__FILE__), '../../test_output')
74
+ @bootstrap_output = File.join(@test_output_directory, '/Output')
75
+
76
+ FileUtils.rm_rf @test_output_directory
77
+ FileUtils.mkdir_p @test_output_directory
78
+
79
+ Dir.chdir(@test_output_directory) do
80
+ @status, @output = run_command("#{@xcbootstrap} create Sample Output")
81
+ end
82
+ end
83
+
84
+ it 'should run successfully' do
85
+ @status.should be_true
86
+ end
87
+
88
+ it 'should have created the output directory' do
89
+ File.exists?(@bootstrap_output).should be_true
90
+ end
91
+
92
+ it 'should have created source and test directories' do
93
+ File.directory?(File.join(@bootstrap_output, "Output")).should be_true
94
+ File.directory?(File.join(@bootstrap_output, "OutputTests")).should be_true
95
+ end
96
+
97
+ it 'should have created all the project files' do
98
+ output_files = Dir.glob("#{@bootstrap_output}/**/{.*,*}").select { |file| !File.directory?(file) }
99
+ output_files.size.should == 13
100
+ end
101
+
102
+ it 'should have the git ignore file renamed' do
103
+ File.exists?(File.join(@bootstrap_output, ".gitignore")).should be_true
104
+ end
105
+
106
+ it 'should have replaced the template with the project name' do
107
+ content = File.read(File.join(@bootstrap_output, "Output.xcodeproj/project.pbxproj"))
108
+ content.should_not include("Sample")
109
+ content.should include("Output")
110
+ end
111
+
112
+ it' should print out the list of files created in the new project' do
113
+ @output.should include("...project.pbxproj")
114
+ end
115
+
116
+ it 'should print out the next steps information' do
117
+ @output.should include("** Next steps **")
118
+ end
119
+ end
47
120
  end
48
121
 
49
- it 'should run successfully' do
50
- @xcbootstrap_result.should be_true
122
+ context 'with a non-existant template option specified' do
123
+ it 'should not run successfully' do
124
+ status, _ = run_command("#{@xcbootstrap} create a-non-existant-template-name")
125
+ status.should be_false
126
+ end
51
127
  end
52
-
53
- it 'should have created the output directory' do
54
- File.exists?(@bootstrap_output).should be_true
128
+
129
+ context 'without no template option specified' do
130
+ it 'should run successfully' do
131
+ status, _ = run_command("#{@xcbootstrap} create")
132
+ status.should be_true
133
+ end
134
+
135
+ it 'should print usage information' do
136
+ _, output = run_command("#{@xcbootstrap} create")
137
+ output.should include("Commands:")
138
+ output.should include("xcbootstrap create")
139
+ end
55
140
  end
56
141
  end
57
142
  end
@@ -1,5 +1,19 @@
1
+ require 'open3'
1
2
  require_relative '../lib/xcbootstrap'
3
+ include XCBootstrap
2
4
 
3
- def some_helper
4
- true
5
+ def run_command cmd
6
+ stdin, stdout, stderr, wait_thr = Open3.popen3(cmd)
7
+ return wait_thr.value.success?, stdout.read
8
+ end
9
+
10
+ def capture_stdout(&block)
11
+ original_stdout = $stdout
12
+ $stdout = fake = StringIO.new
13
+ begin
14
+ yield
15
+ ensure
16
+ $stdout = original_stdout
17
+ end
18
+ fake.string
5
19
  end
@@ -6,35 +6,35 @@ describe 'Bootstrap' do
6
6
 
7
7
  context 'with a template that does not exist' do
8
8
  it 'should raise an error' do
9
- expect { XCBootstrap::Bootstrap.new("/tmp", "non_existant_template", "path-to-project") }.to raise_error
9
+ expect { Bootstrap.new("/tmp", "non_existant_template", "path-to-project") }.to raise_error
10
10
  end
11
11
  end
12
12
 
13
13
  context 'with a template with no manifest' do
14
14
  it 'should raise an error' do
15
15
  FileUtils.mkdir_p "/tmp/template_with_no_manifest"
16
- expect { XCBootstrap::Bootstrap.new("/tmp", "template_with_no_manifest", "path-to-project") }.to raise_error
16
+ expect { Bootstrap.new("/tmp", "template_with_no_manifest", "path-to-project") }.to raise_error
17
17
  end
18
18
  end
19
19
 
20
20
  context 'with an invalid manifest file' do
21
21
  it 'should raise an error' do
22
22
  create_invalid_manifest_with_content "fake manifest..\n... the end"
23
- expect { XCBootstrap::Bootstrap.new("/tmp", "template_with_invalid_manifest", "path-to-project") }.to raise_error
23
+ expect { Bootstrap.new("/tmp", "template_with_invalid_manifest", "path-to-project") }.to raise_error
24
24
  end
25
25
  end
26
26
 
27
27
  context 'with a manifest where files is not an array' do
28
28
  it 'should raise an error' do
29
29
  create_invalid_manifest_with_content "---\nfiles: blah"
30
- expect { XCBootstrap::Bootstrap.new("/tmp", "template_with_invalid_manifest", "path-to-project") }.to raise_error
30
+ expect { Bootstrap.new("/tmp", "template_with_invalid_manifest", "path-to-project") }.to raise_error
31
31
  end
32
32
  end
33
33
 
34
34
  context 'with a manifest where files is empty' do
35
35
  it 'should raise an error' do
36
36
  create_invalid_manifest_with_content "---\nfiles: []"
37
- expect { XCBootstrap::Bootstrap.new("/tmp", "template_with_invalid_manifest", "path-to-project") }.to raise_error
37
+ expect { Bootstrap.new("/tmp", "template_with_invalid_manifest", "path-to-project") }.to raise_error
38
38
  end
39
39
  end
40
40
 
@@ -51,11 +51,11 @@ describe 'Bootstrap' do
51
51
  from_file.puts "some content"
52
52
  end
53
53
 
54
- Dir.stub(:getwd).and_return("/tmp")
54
+ Dir.stub(:pwd).and_return("/tmp/fake-working-dir")
55
55
  end
56
56
 
57
57
  context 'with a relative project path' do
58
- let(:bootstrapper) { XCBootstrap::Bootstrap.new("/tmp", "my_template", "../tmp/path/to/my_project") }
58
+ let(:bootstrapper) { Bootstrap.new("/tmp", "my_template", "../path/to/my_project") }
59
59
 
60
60
  it 'should have the full path to the template' do
61
61
  bootstrapper.template_dir.should == "/tmp/my_template"
@@ -68,6 +68,7 @@ describe 'Bootstrap' do
68
68
  context 'when the template is processed' do
69
69
  before(:each) do
70
70
  File.stub(:binary?).and_return(false)
71
+ File.stub(:image?).and_return(false)
71
72
  bootstrapper.process
72
73
  end
73
74
 
@@ -83,7 +84,7 @@ describe 'Bootstrap' do
83
84
  end
84
85
 
85
86
  context 'with an absolute project path' do
86
- let(:bootstrapper) { XCBootstrap::Bootstrap.new("/tmp", "my_template", "/tmp/path/to/my_project") }
87
+ let(:bootstrapper) { Bootstrap.new("/tmp", "my_template", "/tmp/path/to/my_project") }
87
88
 
88
89
  it 'should leave the project path absolute' do
89
90
  bootstrapper.project_dir.should == "/tmp/path/to/my_project"
@@ -2,32 +2,70 @@ require_relative '../spec_helper'
2
2
 
3
3
  describe 'Cli' do
4
4
  before(:each) do
5
- fake_boostrap = mock().as_null_object
6
- XCBootstrap::Bootstrap.stub(:new).and_return(fake_boostrap)
5
+ @fake_boostrap = mock().as_null_object
6
+ Bootstrap.stub(:new).and_return(@fake_boostrap)
7
+
8
+ Templates.stub(:all_templates).and_return(["template1", "template2"])
9
+
10
+ # Force class reload, as the method names are added automatically
11
+ load File.expand_path(File.join(File.dirname(__FILE__), "../../lib/xcbootstrap/cli.rb"))
7
12
  end
13
+
14
+ let(:cli) { Cli.new }
15
+ let(:create_cli) { Create.new }
8
16
 
9
- context 'with the template and project arguments' do
10
- it 'should point to the default template dir' do
11
- default_template_dir = File.expand_path("templates")
12
- XCBootstrap::Bootstrap.should_receive(:new).with(default_template_dir, anything, anything)
13
- XCBootstrap::Cli.new("", {}).run(["--template", "MyTemplate", "--project", "../MyProject"])
14
- end
17
+ describe 'listing all templates' do
18
+ it 'should print out all available templates' do
19
+ output = capture_stdout { cli.list }
20
+
21
+ output.split.size.should == 3
15
22
 
16
- it 'should bootstrap the project from the template' do
17
- XCBootstrap::Bootstrap.should_receive(:new).with(anything, "MyTemplate", "../MyProject")
18
- XCBootstrap::Cli.new("", {}).run(["--template", "MyTemplate", "--project", "../MyProject"])
23
+ output.should include("Templates:")
24
+ output.should include("template1")
25
+ output.should include("template2")
19
26
  end
20
27
  end
21
28
 
22
- context 'without the template flag' do
23
- it 'should raise an error' do
24
- expect { XCBootstrap::Cli.new("", {}).run(["--project", "../MyProject"]) }.to raise_error
29
+ describe 'creating a new project based on a template' do
30
+ it 'should have the option to create new projects' do
31
+ cli.should respond_to("create")
25
32
  end
26
- end
33
+
34
+ it 'should be able to create each available template' do
35
+ create_cli.should respond_to("template1")
36
+ create_cli.should respond_to("template2")
37
+ end
38
+
39
+ it 'should require the project to be specified' do
40
+ expect { create_cli.template1 }.to raise_error
41
+ end
42
+
43
+ context 'with a project name specified' do
44
+ before(:each) do
45
+
46
+ end
47
+
48
+ it 'should run successfully' do
49
+ expect { create_cli.template1("MyApp") }.to_not raise_error
50
+ end
51
+
52
+ it 'should create the bootstrapper with the template and project' do
53
+ # default_template_dir = File.expand_path("templates")
54
+ Bootstrap.should_receive(:new).with(anything, "template1", "MyApp")
55
+ create_cli.template1("MyApp")
56
+ end
27
57
 
28
- context 'without the project flag' do
29
- it 'should raise an error' do
30
- expect { XCBootstrap::Cli.new("", {}).run(["--template", "MyTemplate"]) }.to raise_error
58
+ it 'should pass through the template root to the bootstrapper' do
59
+ Bootstrap.should_receive(:new).with(/templates/, anything, anything)
60
+ create_cli.template1("MyApp")
61
+ end
62
+
63
+ it 'should process and finish the bootstrapping' do
64
+ @fake_boostrap.should_receive(:process)
65
+ @fake_boostrap.should_receive(:finish)
66
+ create_cli.template1("MyApp")
67
+ end
31
68
  end
32
69
  end
70
+
33
71
  end
@@ -8,7 +8,7 @@ describe 'Template' do
8
8
  let(:project_dir) { "/tmp/output/new_project" }
9
9
 
10
10
  context 'with all fields specified' do
11
- let(:template) { XCBootstrap::Template.new({"from" => "some/path/from","to" => "some/path/to"}, template_dir, project_dir) }
11
+ let(:template) { Template.new({"from" => "some/path/from","to" => "some/path/to"}, template_dir, project_dir) }
12
12
 
13
13
  it 'should have the from field inside the template dir' do
14
14
  template.from.should == "/tmp/template/sample/some/path/from"
@@ -20,7 +20,7 @@ describe 'Template' do
20
20
  end
21
21
 
22
22
  context 'without the to field specified' do
23
- let(:template) { XCBootstrap::Template.new({"from" => "some/path/from"}, template_dir, project_dir) }
23
+ let(:template) { Template.new({"from" => "some/path/from"}, template_dir, project_dir) }
24
24
 
25
25
  it 'should use the from field as the to' do
26
26
  template.to.should == "/tmp/output/new_project/some/path/from"
@@ -28,7 +28,7 @@ describe 'Template' do
28
28
  end
29
29
 
30
30
  context 'with the template name in the from path' do
31
- let(:template) { XCBootstrap::Template.new({"from" => "some/path/including/sample/in/path"}, template_dir, project_dir) }
31
+ let(:template) { Template.new({"from" => "some/path/including/sample/in/path"}, template_dir, project_dir) }
32
32
 
33
33
  it 'should use the from field with the template name replaces with the project name' do
34
34
  template.to.should == "/tmp/output/new_project/some/path/including/new_project/in/path"
@@ -36,10 +36,11 @@ describe 'Template' do
36
36
  end
37
37
 
38
38
  context 'when processing the file' do
39
- let(:template) { XCBootstrap::Template.new({"from" => "path/to/file"}, template_dir, project_dir) }
39
+ let(:template) { Template.new({"from" => "path/to/file"}, template_dir, project_dir) }
40
40
 
41
41
  before(:each) do
42
42
  File.stub(:binary?).and_return(false)
43
+ File.stub(:image?).and_return(false)
43
44
 
44
45
  FileUtils.mkdir_p "/tmp/template/sample/path/to/"
45
46
  File.open "/tmp/template/sample/path/to/file", "w" do |from_file|
@@ -66,19 +67,28 @@ describe 'Template' do
66
67
  end
67
68
  end
68
69
 
69
- context 'when processing a binary file' do
70
- let(:template) { XCBootstrap::Template.new({"from" => "path/to/binary/file"}, template_dir, project_dir) }
70
+ context 'when processing binary and image files' do
71
+ let(:template) { Template.new({"from" => "path/to/binary/file"}, template_dir, project_dir) }
71
72
 
72
73
  before(:each) do
73
- File.stub(:binary?).and_return(true)
74
-
75
74
  FileUtils.mkdir_p "/tmp/template/sample/path/to/binary"
76
75
  File.open "/tmp/template/sample/path/to/binary/file", "wb" do |from_file|
77
76
  from_file.puts "content including sample name"
78
77
  end
79
78
  end
80
79
 
81
- it 'should not replace occurances of the template name' do
80
+ it 'should not replace occurances of the template name in binary files' do
81
+ File.stub(:binary?).and_return(true)
82
+ File.stub(:image?).and_return(false)
83
+
84
+ template.process
85
+ File.read("/tmp/output/new_project/path/to/binary/file").should include("sample")
86
+ end
87
+
88
+ it 'should not replace occurances of the template name in image files' do
89
+ File.stub(:binary?).and_return(false)
90
+ File.stub(:image?).and_return(true)
91
+
82
92
  template.process
83
93
  File.read("/tmp/output/new_project/path/to/binary/file").should include("sample")
84
94
  end
@@ -0,0 +1,39 @@
1
+ require_relative '../spec_helper'
2
+
3
+ describe 'templates' do
4
+
5
+ it 'should have a list of available templates' do
6
+ Templates.all_templates.should_not be_empty
7
+ end
8
+
9
+ context 'each available template' do
10
+ it 'should be specified by the name of the template, not the path' do
11
+ Templates.all_templates.each do |template_name|
12
+ File.basename(template_name).should == template_name
13
+ end
14
+ end
15
+
16
+ it 'should have a valid template name' do
17
+ Templates.all_templates.each do |template_name|
18
+ template = Templates.new(template_name)
19
+ template.template_name.should == template_name
20
+ end
21
+ end
22
+
23
+ it 'should have a path ending to the template name' do
24
+ Templates.all_templates.each do |template_name|
25
+ template = Templates.new(template_name)
26
+ File.basename(template.path).should == template_name
27
+ end
28
+ end
29
+
30
+ it 'should have a valid manifest' do
31
+ Templates.all_templates.each do |template_name|
32
+ template = Templates.new(template_name)
33
+ File.exists?(template.manifest).should be_true
34
+ end
35
+ end
36
+
37
+
38
+ end
39
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcbootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stewart Gleadow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-29 00:00:00.000000000 Z
11
+ date: 2014-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ptools
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 1.1.7
19
+ version: 1.2.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 1.1.7
26
+ version: 1.2.4
27
27
  - !ruby/object:Gem::Dependency
28
- name: clamp
28
+ name: thor
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 0.6.1
33
+ version: '0.18'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: 0.6.1
40
+ version: '0.18'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -93,6 +93,7 @@ files:
93
93
  - lib/xcbootstrap/cli.rb
94
94
  - lib/xcbootstrap/next_steps.txt
95
95
  - lib/xcbootstrap/template.rb
96
+ - lib/xcbootstrap/templates.rb
96
97
  - lib/xcbootstrap/version.rb
97
98
  - templates/Sample/Sample.xcodeproj/project.pbxproj
98
99
  - templates/Sample/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -177,8 +178,9 @@ files:
177
178
  - spec/unit/bootstrap_spec.rb
178
179
  - spec/unit/cli_spec.rb
179
180
  - spec/unit/template_spec.rb
181
+ - spec/unit/templates_spec.rb
180
182
  - bin/xcbootstrap
181
- homepage: https://github.com/sgleadow/xcodebootstrap
183
+ homepage: https://github.com/sgleadow/xcbootstrap
182
184
  licenses: []
183
185
  metadata: {}
184
186
  post_install_message:
@@ -197,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
199
  version: '0'
198
200
  requirements: []
199
201
  rubyforge_project:
200
- rubygems_version: 2.0.3
202
+ rubygems_version: 2.0.5
201
203
  signing_key:
202
204
  specification_version: 4
203
205
  summary: Bootstrap iOS projects with builds and testing already configured
@@ -207,3 +209,4 @@ test_files:
207
209
  - spec/unit/bootstrap_spec.rb
208
210
  - spec/unit/cli_spec.rb
209
211
  - spec/unit/template_spec.rb
212
+ - spec/unit/templates_spec.rb