paper_house 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +46 -12
  3. data/LICENSE +674 -0
  4. data/README.md +18 -10
  5. data/Rakefile +7 -117
  6. data/features/executable_task.feature +6 -0
  7. data/features/step_definitions/paper_house_steps.rb +1 -1
  8. data/features/support/env.rb +3 -32
  9. data/lib/paper_house/auto_depends.rb +4 -23
  10. data/lib/paper_house/build_failed.rb +18 -0
  11. data/lib/paper_house/build_task.rb +10 -24
  12. data/lib/paper_house/cc_options.rb +1 -23
  13. data/lib/paper_house/dependency.rb +1 -23
  14. data/lib/paper_house/executable_task.rb +1 -27
  15. data/lib/paper_house/library_task.rb +1 -23
  16. data/lib/paper_house/linker_options.rb +1 -23
  17. data/lib/paper_house/platform.rb +11 -32
  18. data/lib/paper_house/ruby_extension_task.rb +1 -27
  19. data/lib/paper_house/safe_popen.rb +1 -23
  20. data/lib/paper_house/shared_library_task.rb +1 -27
  21. data/lib/paper_house/static_library_task.rb +2 -24
  22. data/lib/paper_house/version.rb +2 -24
  23. data/lib/paper_house.rb +1 -23
  24. data/paper_house.gemspec +11 -9
  25. data/spec/paper_house/executable_task_spec.rb +26 -53
  26. data/spec/paper_house/ruby_extension_task_spec.rb +26 -53
  27. data/spec/paper_house/shared_library_task_spec.rb +30 -57
  28. data/spec/paper_house/static_library_task_spec.rb +41 -68
  29. data/spec/paper_house/version_spec.rb +1 -23
  30. data/spec/spec_helper.rb +3 -31
  31. metadata +24 -67
  32. data/.gitignore +0 -19
  33. data/.rspec +0 -3
  34. data/.rubocop.yml +0 -1
  35. data/.ruby-version +0 -1
  36. data/.travis.yml +0 -18
  37. data/Gemfile +0 -35
  38. data/Guardfile +0 -22
  39. data/cucumber.yml +0 -3
  40. data/examples/executable/.gitignore +0 -4
  41. data/examples/executable/Rakefile +0 -5
  42. data/examples/executable/Rakefile.llvm +0 -5
  43. data/examples/executable/hello.c +0 -7
  44. data/examples/executable_subdirs/.gitignore +0 -4
  45. data/examples/executable_subdirs/Rakefile +0 -11
  46. data/examples/executable_subdirs/includes/hello.h +0 -1
  47. data/examples/executable_subdirs/sources/hello.c +0 -6
  48. data/examples/executable_subdirs/sources/main.c +0 -8
  49. data/examples/ruby_extension/.gitignore +0 -5
  50. data/examples/ruby_extension/Rakefile +0 -5
  51. data/examples/ruby_extension/Rakefile.llvm +0 -5
  52. data/examples/ruby_extension/hello.c +0 -6
  53. data/examples/shared_library/.gitignore +0 -8
  54. data/examples/shared_library/Rakefile +0 -23
  55. data/examples/shared_library/Rakefile.llvm +0 -25
  56. data/examples/shared_library/hello.c +0 -6
  57. data/examples/shared_library/hello.h +0 -1
  58. data/examples/shared_library/main.c +0 -7
  59. data/examples/shared_library_subdirs/.gitignore +0 -8
  60. data/examples/shared_library_subdirs/Rakefile +0 -28
  61. data/examples/shared_library_subdirs/includes/hello.h +0 -1
  62. data/examples/shared_library_subdirs/sources/hello.c +0 -6
  63. data/examples/shared_library_subdirs/sources/main.c +0 -8
  64. data/examples/static_library/.gitignore +0 -7
  65. data/examples/static_library/Rakefile +0 -14
  66. data/examples/static_library/Rakefile.llvm +0 -14
  67. data/examples/static_library/hello.c +0 -6
  68. data/examples/static_library/hello.h +0 -1
  69. data/examples/static_library/main.c +0 -7
  70. data/examples/static_library_subdirs/.gitignore +0 -7
  71. data/examples/static_library_subdirs/Rakefile +0 -19
  72. data/examples/static_library_subdirs/includes/hello.h +0 -1
  73. data/examples/static_library_subdirs/sources/hello.c +0 -6
  74. data/examples/static_library_subdirs/sources/main.c +0 -8
  75. data/rake_simplecov_hook.rb +0 -24
  76. data/rubocop-todo.yml +0 -6
@@ -1,20 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013 NEC Corporation
4
- #
5
- # This program is free software; you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License, version 3, as
7
- # published by the Free Software Foundation.
8
- #
9
- # This program is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- # GNU General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU General Public License along
15
- # with this program; if not, write to the Free Software Foundation, Inc.,
16
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
- #
1
+ # encoding: utf-8
18
2
 
19
3
  require 'paper_house/library_task'
20
4
  require 'paper_house/linker_options'
@@ -53,10 +37,6 @@ module PaperHouse
53
37
 
54
38
  private
55
39
 
56
- def generate_target
57
- sh(([cc] + cc_options).join(' '))
58
- end
59
-
60
40
  def cc_options
61
41
  ['-shared', wl_option, o_option, objects, ldflags, l_options].flatten
62
42
  end
@@ -70,9 +50,3 @@ module PaperHouse
70
50
  end
71
51
  end
72
52
  end
73
-
74
- ### Local variables:
75
- ### mode: Ruby
76
- ### coding: utf-8-unix
77
- ### indent-tabs-mode: nil
78
- ### End:
@@ -1,20 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013 NEC Corporation
4
- #
5
- # This program is free software; you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License, version 3, as
7
- # published by the Free Software Foundation.
8
- #
9
- # This program is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- # GNU General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU General Public License along
15
- # with this program; if not, write to the Free Software Foundation, Inc.,
16
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
- #
1
+ # encoding: utf-8
18
2
 
19
3
  require 'paper_house/library_task'
20
4
 
@@ -40,7 +24,7 @@ module PaperHouse
40
24
  end
41
25
 
42
26
  def ar
43
- sh "ar -cq #{target_path} #{objects.to_s}"
27
+ sh "ar -cq #{target_path} #{objects}"
44
28
  end
45
29
 
46
30
  def ranlib
@@ -48,9 +32,3 @@ module PaperHouse
48
32
  end
49
33
  end
50
34
  end
51
-
52
- ### Local variables:
53
- ### mode: Ruby
54
- ### coding: utf-8-unix
55
- ### indent-tabs-mode: nil
56
- ### End:
@@ -1,29 +1,7 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013 NEC Corporation
4
- #
5
- # This program is free software; you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License, version 3, as
7
- # published by the Free Software Foundation.
8
- #
9
- # This program is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- # GNU General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU General Public License along
15
- # with this program; if not, write to the Free Software Foundation, Inc.,
16
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
- #
1
+ # encoding: utf-8
18
2
 
19
3
  # Base module.
20
4
  module PaperHouse
21
5
  # gem version.
22
- VERSION = '0.5.0'
6
+ VERSION = '0.6.0'
23
7
  end
24
-
25
- ### Local variables:
26
- ### mode: Ruby
27
- ### coding: utf-8
28
- ### indent-tabs-mode: nil
29
- ### End:
data/lib/paper_house.rb CHANGED
@@ -1,29 +1,7 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013 NEC Corporation
4
- #
5
- # This program is free software; you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License, version 3, as
7
- # published by the Free Software Foundation.
8
- #
9
- # This program is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- # GNU General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU General Public License along
15
- # with this program; if not, write to the Free Software Foundation, Inc.,
16
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
- #
1
+ # encoding: utf-8
18
2
 
19
3
  require 'paper_house/executable_task'
20
4
  require 'paper_house/ruby_extension_task'
21
5
  require 'paper_house/shared_library_task'
22
6
  require 'paper_house/static_library_task'
23
7
  require 'paper_house/version'
24
-
25
- ### Local variables:
26
- ### mode: Ruby
27
- ### coding: utf-8-unix
28
- ### indent-tabs-mode: nil
29
- ### End:
data/paper_house.gemspec CHANGED
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  lib = File.expand_path('../lib', __FILE__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'paper_house/version'
@@ -14,19 +16,19 @@ Gem::Specification.new do |gem|
14
16
  gem.email = ['yasuhito@gmail.com']
15
17
  gem.homepage = 'http://github.com/trema/paper-house'
16
18
 
17
- gem.files = `git ls-files`.split("\n")
19
+ gem.files = %w(CONTRIBUTING.md LICENSE Rakefile paper_house.gemspec)
20
+ gem.files += Dir.glob('lib/**/*.rb')
21
+ gem.files += Dir.glob('bin/**/*')
22
+ gem.files += Dir.glob('spec/**/*')
23
+ gem.files += Dir.glob('features/**/*')
18
24
 
19
25
  gem.require_paths = ['lib']
20
26
 
21
27
  gem.extra_rdoc_files = ['README.md']
22
- gem.test_files = `git ls-files -- {spec,features}/*`.split("\n")
28
+ gem.test_files = Dir.glob('spec/**/*')
29
+ gem.test_files += Dir.glob('features/**/*')
23
30
 
31
+ gem.required_ruby_version = '>= 1.9.3'
24
32
  gem.add_dependency 'POpen4', '~> 0.1.4'
25
- gem.add_dependency 'rake', '~> 10.1.0'
33
+ gem.add_dependency 'rake', '~> 10.2.1'
26
34
  end
27
-
28
- ### Local variables:
29
- ### mode: Ruby
30
- ### coding: utf-8-unix
31
- ### indent-tabs-mode: nil
32
- ### End:
@@ -1,20 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013 NEC Corporation
4
- #
5
- # This program is free software; you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License, version 3, as
7
- # published by the Free Software Foundation.
8
- #
9
- # This program is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- # GNU General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU General Public License along
15
- # with this program; if not, write to the Free Software Foundation, Inc.,
16
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
- #
1
+ # encoding: utf-8
18
2
 
19
3
  require 'paper_house/executable_task'
20
4
 
@@ -46,49 +30,38 @@ describe Rake::Task do
46
30
  end
47
31
  end
48
32
 
49
- #
50
- # PaperHouse::ExecutableTask spec.
51
- #
52
- module PaperHouse
53
- describe ExecutableTask, '.new' do
54
- context 'with name :test' do
55
- subject { ExecutableTask.new :test }
33
+ describe PaperHouse::ExecutableTask, '.new' do
34
+ context 'with name :test' do
35
+ subject { PaperHouse::ExecutableTask.new :test }
56
36
 
57
- its(:cc) { should eq 'gcc' }
58
- its(:cflags) { should be_empty }
59
- its(:executable_name) { should eq 'test' }
60
- its(:includes) { should be_empty }
61
- its(:ldflags) { should be_empty }
62
- its(:library_dependencies) { should be_empty }
63
- its(:name) { should eq 'test' }
64
- its(:sources) { should eq '*.c' }
65
- its(:target_directory) { should eq '.' }
66
- end
37
+ its(:cc) { should eq 'gcc' }
38
+ its(:cflags) { should be_empty }
39
+ its(:executable_name) { should eq 'test' }
40
+ its(:includes) { should be_empty }
41
+ its(:ldflags) { should be_empty }
42
+ its(:library_dependencies) { should be_empty }
43
+ its(:name) { should eq 'test' }
44
+ its(:sources) { should eq '*.c' }
45
+ its(:target_directory) { should eq '.' }
46
+ end
67
47
 
68
- context 'with :test and block' do
69
- subject do
70
- ExecutableTask.new(:test) do | task |
71
- task.executable_name = executable_name
72
- end
48
+ context 'with :test and block' do
49
+ subject do
50
+ PaperHouse::ExecutableTask.new(:test) do | task |
51
+ task.executable_name = executable_name
73
52
  end
53
+ end
74
54
 
75
- context %{with #executable_name = 'new_name'} do
76
- let(:executable_name) { 'new_name' }
55
+ context %(with #executable_name = 'new_name') do
56
+ let(:executable_name) { 'new_name' }
77
57
 
78
- its(:executable_name) { should eq 'new_name' }
79
- end
58
+ its(:executable_name) { should eq 'new_name' }
59
+ end
80
60
 
81
- context 'with #executable_name = :new_name' do
82
- let(:executable_name) { :new_name }
61
+ context 'with #executable_name = :new_name' do
62
+ let(:executable_name) { :new_name }
83
63
 
84
- its(:executable_name) { should eq :new_name }
85
- end
64
+ its(:executable_name) { should eq :new_name }
86
65
  end
87
66
  end
88
67
  end
89
-
90
- ### Local variables:
91
- ### mode: Ruby
92
- ### coding: utf-8-unix
93
- ### indent-tabs-mode: nil
94
- ### End:
@@ -1,20 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013 NEC Corporation
4
- #
5
- # This program is free software; you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License, version 3, as
7
- # published by the Free Software Foundation.
8
- #
9
- # This program is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- # GNU General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU General Public License along
15
- # with this program; if not, write to the Free Software Foundation, Inc.,
16
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
- #
1
+ # encoding: utf-8
18
2
 
19
3
  require 'paper_house/ruby_extension_task'
20
4
 
@@ -46,51 +30,46 @@ describe Rake::Task do
46
30
  end
47
31
  end
48
32
 
49
- #
50
- # PaperHouse::RubyExtensionTask spec.
51
- #
52
- module PaperHouse
53
- describe RubyExtensionTask, '.new :test' do
54
- before { Rake::Task.clear }
33
+ describe PaperHouse::RubyExtensionTask do
34
+ before { Rake::Task.clear }
55
35
 
56
- describe '.find_named' do
57
- subject { RubyExtensionTask.find_named name }
36
+ describe '.find_named' do
37
+ subject { PaperHouse::RubyExtensionTask.find_named name }
58
38
 
59
- context 'with :test' do
60
- let(:name) { :test }
39
+ context 'with :test' do
40
+ let(:name) { :test }
61
41
 
62
- context 'when RubyExtensionTask named :test is defined' do
63
- before { RubyExtensionTask.new :test }
42
+ context 'when RubyExtensionTask named :test is defined' do
43
+ before { PaperHouse::RubyExtensionTask.new :test }
64
44
 
65
- it { expect(subject).to be_a RubyExtensionTask }
66
- end
45
+ it { expect(subject).to be_a PaperHouse::RubyExtensionTask }
46
+ end
67
47
 
68
- context 'when RubyExtensionTask named :test is not defined' do
69
- it { expect(subject).to be_nil }
70
- end
48
+ context 'when RubyExtensionTask named :test is not defined' do
49
+ it { expect(subject).to be_nil }
71
50
  end
51
+ end
72
52
 
73
- context %{with 'test'} do
74
- let(:name) { 'test' }
53
+ context %(with 'test') do
54
+ let(:name) { 'test' }
75
55
 
76
- context %{when RubyExtensionTask named 'test' is defined} do
77
- before { RubyExtensionTask.new :test }
56
+ context %(when RubyExtensionTask named 'test' is defined) do
57
+ before { PaperHouse::RubyExtensionTask.new :test }
78
58
 
79
- it { expect(subject).to be_a RubyExtensionTask }
80
- end
59
+ it { expect(subject).to be_a PaperHouse::RubyExtensionTask }
81
60
  end
61
+ end
82
62
 
83
- context 'with :no_such_task' do
84
- let(:name) { :no_such_task }
63
+ context 'with :no_such_task' do
64
+ let(:name) { :no_such_task }
85
65
 
86
- it { expect(subject).to be_nil }
87
- end
66
+ it { expect(subject).to be_nil }
88
67
  end
89
68
  end
90
69
 
91
70
  describe '.new' do
92
71
  context 'with :test' do
93
- subject { RubyExtensionTask.new :test }
72
+ subject { PaperHouse::RubyExtensionTask.new :test }
94
73
 
95
74
  its(:cc) { should eq 'gcc' }
96
75
  its(:cflags) { should be_empty }
@@ -102,12 +81,12 @@ module PaperHouse
102
81
 
103
82
  context 'with :test and block' do
104
83
  subject do
105
- RubyExtensionTask.new(:test) do | task |
84
+ PaperHouse::RubyExtensionTask.new(:test) do | task |
106
85
  task.library_name = library_name
107
86
  end
108
87
  end
109
88
 
110
- context %{with #library_name = 'new_name'} do
89
+ context %(with #library_name = 'new_name') do
111
90
  let(:library_name) { 'new_name' }
112
91
 
113
92
  its(:library_name) { should eq 'new_name' }
@@ -121,9 +100,3 @@ module PaperHouse
121
100
  end
122
101
  end
123
102
  end
124
-
125
- ### Local variables:
126
- ### mode: Ruby
127
- ### coding: utf-8-unix
128
- ### indent-tabs-mode: nil
129
- ### End:
@@ -1,20 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013 NEC Corporation
4
- #
5
- # This program is free software; you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License, version 3, as
7
- # published by the Free Software Foundation.
8
- #
9
- # This program is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- # GNU General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU General Public License along
15
- # with this program; if not, write to the Free Software Foundation, Inc.,
16
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
- #
1
+ # encoding: utf-8
18
2
 
19
3
  require 'paper_house/shared_library_task'
20
4
 
@@ -46,51 +30,46 @@ describe Rake::Task do
46
30
  end
47
31
  end
48
32
 
49
- #
50
- # PaperHouse::SharedLibraryTask spec.
51
- #
52
- module PaperHouse
53
- describe SharedLibraryTask do
54
- before { Rake::Task.clear }
33
+ describe PaperHouse::SharedLibraryTask do
34
+ before { Rake::Task.clear }
55
35
 
56
- describe '.find_named' do
57
- subject { SharedLibraryTask.find_named name }
36
+ describe '.find_named' do
37
+ subject { PaperHouse::SharedLibraryTask.find_named name }
58
38
 
59
- context 'with :libtest' do
60
- let(:name) { :libtest }
39
+ context 'with :libtest' do
40
+ let(:name) { :libtest }
61
41
 
62
- context 'when SharedLibraryTask named :libtest is defined' do
63
- before { SharedLibraryTask.new :libtest, '0.1.0' }
42
+ context 'when SharedLibraryTask named :libtest is defined' do
43
+ before { PaperHouse::SharedLibraryTask.new :libtest, '0.1.0' }
64
44
 
65
- it { expect(subject).to be_a SharedLibraryTask }
66
- end
45
+ it { expect(subject).to be_a PaperHouse::SharedLibraryTask }
46
+ end
67
47
 
68
- context 'when SharedLibraryTask named :libtest is not defined' do
69
- it { expect(subject).to be_nil }
70
- end
48
+ context 'when SharedLibraryTask named :libtest is not defined' do
49
+ it { expect(subject).to be_nil }
71
50
  end
51
+ end
72
52
 
73
- context %{with 'libtest'} do
74
- let(:name) { 'libtest' }
53
+ context %(with 'libtest') do
54
+ let(:name) { 'libtest' }
75
55
 
76
- context %{when SharedLibraryTask named 'libtest' is defined} do
77
- before { SharedLibraryTask.new :libtest, '0.1.0' }
56
+ context %(when SharedLibraryTask named 'libtest' is defined) do
57
+ before { PaperHouse::SharedLibraryTask.new :libtest, '0.1.0' }
78
58
 
79
- it { expect(subject).to be_a SharedLibraryTask }
80
- end
59
+ it { expect(subject).to be_a PaperHouse::SharedLibraryTask }
81
60
  end
61
+ end
82
62
 
83
- context 'with :no_such_task' do
84
- let(:name) { :no_such_task }
63
+ context 'with :no_such_task' do
64
+ let(:name) { :no_such_task }
85
65
 
86
- it { expect(subject).to be_nil }
87
- end
66
+ it { expect(subject).to be_nil }
88
67
  end
89
68
  end
90
69
 
91
70
  describe '.new' do
92
- context %{with name :libtest and version '0.1.0'} do
93
- subject { SharedLibraryTask.new :libtest, '0.1.0' }
71
+ context %(with name :libtest and version '0.1.0') do
72
+ subject { PaperHouse::SharedLibraryTask.new :libtest, '0.1.0' }
94
73
 
95
74
  its(:cc) { should eq 'gcc' }
96
75
  its(:cflags) { should be_empty }
@@ -107,7 +86,7 @@ module PaperHouse
107
86
  end
108
87
 
109
88
  context 'with name :libtest and no version string' do
110
- subject { SharedLibraryTask.new :libtest }
89
+ subject { PaperHouse::SharedLibraryTask.new :libtest }
111
90
 
112
91
  it do
113
92
  expect { subject }.to raise_error('version option is a mandatory.')
@@ -116,16 +95,16 @@ module PaperHouse
116
95
 
117
96
  context 'with name :libtest and block' do
118
97
  subject do
119
- SharedLibraryTask.new(:libtest) do | task |
98
+ PaperHouse::SharedLibraryTask.new(:libtest) do | task |
120
99
  task.library_name = library_name
121
100
  task.version = version
122
101
  end
123
102
  end
124
103
 
125
- context %{with #version = '0.1.0'} do
104
+ context %(with #version = '0.1.0') do
126
105
  let(:version) { '0.1.0' }
127
106
 
128
- context %{with #library_name = 'libtest'} do
107
+ context %(with #library_name = 'libtest') do
129
108
  let(:library_name) { 'libtest' }
130
109
 
131
110
  its(:library_name) { should eq 'libtest' }
@@ -137,7 +116,7 @@ module PaperHouse
137
116
  its(:library_name) { should eq 'libtest' }
138
117
  end
139
118
 
140
- context %{with #library_name = 'test'} do
119
+ context %(with #library_name = 'test') do
141
120
  let(:library_name) { 'test' }
142
121
 
143
122
  its(:library_name) { should eq 'libtest' }
@@ -161,9 +140,3 @@ module PaperHouse
161
140
  end
162
141
  end
163
142
  end
164
-
165
- ### Local variables:
166
- ### mode: Ruby
167
- ### coding: utf-8-unix
168
- ### indent-tabs-mode: nil
169
- ### End:
@@ -1,24 +1,8 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013 NEC Corporation
4
- #
5
- # This program is free software; you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License, version 3, as
7
- # published by the Free Software Foundation.
8
- #
9
- # This program is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- # GNU General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU General Public License along
15
- # with this program; if not, write to the Free Software Foundation, Inc.,
16
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
- #
1
+ # encoding: utf-8
18
2
 
19
3
  require 'paper_house/static_library_task'
20
4
 
21
- describe 'Rake::Task' do
5
+ describe Rake::Task do
22
6
  before { Rake::Task.clear }
23
7
 
24
8
  describe '.[]' do
@@ -46,70 +30,59 @@ describe 'Rake::Task' do
46
30
  end
47
31
  end
48
32
 
49
- #
50
- # PaperHouse::StaticLibraryTask spec.
51
- #
52
- module PaperHouse
53
- describe StaticLibraryTask do
54
- before { Rake::Task.clear }
33
+ describe PaperHouse::StaticLibraryTask do
34
+ before { Rake::Task.clear }
55
35
 
56
- describe '.find_named' do
57
- subject { StaticLibraryTask.find_named name }
36
+ describe '.find_named' do
37
+ subject { PaperHouse::StaticLibraryTask.find_named name }
58
38
 
59
- context 'with :libtest' do
60
- let(:name) { :libtest }
39
+ context 'with :libtest' do
40
+ let(:name) { :libtest }
61
41
 
62
- context 'when StaticLibraryTask named :libtest is defined' do
63
- before { StaticLibraryTask.new :libtest }
42
+ context 'when StaticLibraryTask named :libtest is defined' do
43
+ before { PaperHouse::StaticLibraryTask.new :libtest }
64
44
 
65
- it { expect(subject).to be_a StaticLibraryTask }
66
- end
45
+ it { expect(subject).to be_a PaperHouse::StaticLibraryTask }
46
+ end
67
47
 
68
- context 'when StaticLibraryTask named :libtest is not defined' do
69
- it { expect(subject).to be_nil }
70
- end
48
+ context 'when StaticLibraryTask named :libtest is not defined' do
49
+ it { expect(subject).to be_nil }
71
50
  end
51
+ end
72
52
 
73
- context %{with 'libtest'} do
74
- let(:name) { 'libtest' }
53
+ context %(with 'libtest') do
54
+ let(:name) { 'libtest' }
75
55
 
76
- context 'when StaticLibraryTask named :libtest is defined' do
77
- before { StaticLibraryTask.new :libtest }
56
+ context 'when StaticLibraryTask named :libtest is defined' do
57
+ before { PaperHouse::StaticLibraryTask.new :libtest }
78
58
 
79
- it { expect(subject).to be_a StaticLibraryTask }
80
- end
59
+ it { expect(subject).to be_a PaperHouse::StaticLibraryTask }
81
60
  end
61
+ end
82
62
 
83
- context 'with :no_such_task' do
84
- let(:name) { :no_such_task }
63
+ context 'with :no_such_task' do
64
+ let(:name) { :no_such_task }
85
65
 
86
- it { expect(subject).to be_nil }
87
- end
66
+ it { expect(subject).to be_nil }
88
67
  end
68
+ end
89
69
 
90
- describe '.new' do
91
- subject { StaticLibraryTask.new task }
92
-
93
- context 'with :libtest' do
94
- let(:task) { :libtest }
95
-
96
- its(:cc) { should eq 'gcc' }
97
- its(:cflags) { should be_empty }
98
- its(:includes) { should be_empty }
99
- its(:name) { should eq 'libtest' }
100
- its(:sources) { should eq '*.c' }
101
- its(:target_directory) { should eq '.' }
102
- its(:library_name) { should eq 'libtest' }
103
- its(:lname) { should eq 'test' }
104
- its(:target_file_name) { should eq 'libtest.a' }
105
- its(:target_path) { should eq './libtest.a' }
106
- end
70
+ describe '.new' do
71
+ subject { PaperHouse::StaticLibraryTask.new task }
72
+
73
+ context 'with :libtest' do
74
+ let(:task) { :libtest }
75
+
76
+ its(:cc) { should eq 'gcc' }
77
+ its(:cflags) { should be_empty }
78
+ its(:includes) { should be_empty }
79
+ its(:name) { should eq 'libtest' }
80
+ its(:sources) { should eq '*.c' }
81
+ its(:target_directory) { should eq '.' }
82
+ its(:library_name) { should eq 'libtest' }
83
+ its(:lname) { should eq 'test' }
84
+ its(:target_file_name) { should eq 'libtest.a' }
85
+ its(:target_path) { should eq './libtest.a' }
107
86
  end
108
87
  end
109
88
  end
110
-
111
- ### Local variables:
112
- ### mode: Ruby
113
- ### coding: utf-8-unix
114
- ### indent-tabs-mode: nil
115
- ### End: