projecter 0.1.2 → 0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4fd4c1f214c67d7cc245cc581667604fb7681894
4
- data.tar.gz: 0367ee8d2e48bc7c038461990c4b4b53c812a436
3
+ metadata.gz: 15c4190d421e6827ada523793bdb8b9f1a8e5ea4
4
+ data.tar.gz: f0d427b32bab5246a59965c29dd116d5e07aa751
5
5
  SHA512:
6
- metadata.gz: d0eb580c786a5e9a2cf11429665d05750f8f087479cea6be98be197644e2799937944820f84905bb20798a5288408f8a8bb0927415367050554728f37fa87b7b
7
- data.tar.gz: b74dced3d3b7526747e2e1a9c27631e2da0926e929b4014f628c28ace63fb61b20e0a8820831eea3292d4f754bf24a5603d0e86e4c0528cf97e1ea6897e9973c
6
+ metadata.gz: 5bf6f6fc4bac85bd28b0adf2c534789dc087dc38828dd36b3e94a250411f4bd2eb2020d143ad8f187096b369586753ed40bdc0fcda9de3343ddb40b274accedf
7
+ data.tar.gz: f9cbfedafb7b5b2d661849bf047b0472e6f16e7f9e5dae5389e8ab21cca08612cdcc52a442be7bf37e331653333ec659369de457a50b1eb3fbd580de2bc9c99f
@@ -34,7 +34,6 @@ class ProjecterCLI < Thor
34
34
  lib_templates = {
35
35
  'gemspec.tt' => "#{project}.gemspec",
36
36
  'README.md.tt' => 'README.md',
37
- 'reek.tt' => "#{project}.reek",
38
37
  'mainlib.rb.tt' => ['lib', "#{project}.rb"],
39
38
  'version.rb.tt' => ['lib', project, 'version.rb'],
40
39
  'spec_helper.rb.tt' => %w(spec spec_helper.rb),
@@ -48,7 +47,7 @@ class ProjecterCLI < Thor
48
47
  }
49
48
 
50
49
  templates = lib_templates
51
- templates.merge(app_templates) unless options.library?
50
+ templates.merge!(app_templates) unless options.library?
52
51
 
53
52
  projecter_template(
54
53
  templates,
@@ -1,3 +1,3 @@
1
1
  module Projecter
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
@@ -1,16 +1,8 @@
1
1
  require 'commands/create'
2
2
 
3
- shared_examples_for 'a library' do
3
+ shared_examples_for 'a project' do
4
4
  let(:project) { 'test_project' }
5
5
 
6
- subject do
7
- described_class.class_options(
8
- quiet: true,
9
- pretend: true
10
- )
11
- described_class.new(['--library'])
12
- end
13
-
14
6
  after do
15
7
  subject.create(project)
16
8
  end
@@ -23,27 +15,69 @@ shared_examples_for 'a library' do
23
15
  it "creates spec/#{dir}/lib/project" do
24
16
  expect(subject).to receive(:empty_directory).with(File.join(project, 'spec', dir, 'lib', project))
25
17
  end
26
-
27
- it "creates spec/#{dir}/lib/commands" do
28
- expect(subject).to receive(:empty_directory).with(File.join(project, 'spec', dir, 'lib/commands'))
29
- end
30
18
  end
31
19
  end
32
20
 
33
21
  RSpec.describe ProjecterCLI do
34
22
  describe '#create_project_dirs' do
35
23
  let(:project) { 'test_project' }
24
+ let(:options) do
25
+ {
26
+ library: library
27
+ }
28
+ end
29
+
30
+ subject do
31
+ described_class.class_options(
32
+ quiet: true,
33
+ pretend: true
34
+ )
35
+ described_class.new([], library: library)
36
+ end
36
37
 
37
38
  before do
38
39
  allow(subject).to receive(:empty_directory).and_return(true)
39
40
  end
40
41
 
42
+ after do
43
+ subject.create(project)
44
+ end
45
+
41
46
  context 'when in library mode' do
42
- it_behaves_like 'a library'
47
+ let(:library) { true }
48
+ it_behaves_like 'a project'
49
+
50
+ it 'does not create lib/commands' do
51
+ expect(subject).not_to receive(:empty_directory).with(File.join(project, 'lib/commands'))
52
+ subject.create(project)
53
+ end
54
+
55
+ it 'does not create a main app' do
56
+ expect(subject).not_to receive(:chmod).with(File.join(project, 'bin', project), 0755)
57
+ subject.create(project)
58
+ end
43
59
  end
44
60
 
45
61
  context 'when not in library mode' do
46
- it_behaves_like 'a library'
62
+ let(:library) { false }
63
+ let(:main_app) { File.join(project, 'bin', project) }
64
+ it_behaves_like 'a project'
65
+
66
+ before do
67
+ allow(File).to receive(:stat).with(main_app) { double('dirent', mode: 0644) }
68
+ allow(subject).to receive(:chmod).with(main_app, 0755).and_return(true)
69
+ end
70
+
71
+ it 'makes the main app executable' do
72
+ expect(File).to receive(:stat).with(main_app) { double('dirent', mode: 0644) }
73
+ expect(subject).to receive(:chmod).with(main_app, 0755).and_return(true)
74
+ end
75
+
76
+ %w(unit integration acceptance).each do |dir|
77
+ it "creates spec/#{dir}/lib/commands" do
78
+ expect(subject).to receive(:empty_directory).with(File.join(project, 'spec', dir, 'lib/commands'))
79
+ end
80
+ end
47
81
  end
48
82
  end
49
83
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: projecter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Poirier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-12 00:00:00.000000000 Z
11
+ date: 2015-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor