rake-delphi 0.0.29 → 0.0.30

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: 2fac8338f63859adafff7ad6681916eada8c35b5
4
- data.tar.gz: 08d7384ceae2e954237f3260d52e3c5d01289c28
3
+ metadata.gz: 85268a1c9740bd8216fad6d4693c671089f0d226
4
+ data.tar.gz: d33a4a9546706b44ab6f8d70b686bee4847a1ec9
5
5
  SHA512:
6
- metadata.gz: 7eb163f1d211c08f314fd66c8e8b2ef02feefd7a9fe1be6dfdb92748deee25c6ee04b3126178fcdf21ba04eb093908dee0f6180de07985a498af048fe76cbbff
7
- data.tar.gz: 2f0c7ee26b2dbb4031d499a2b79f1acec268afee6fe2d16f20980f226fbe095f2205c3ff82a59192088c602a73385558fb015e063e08ebb9dbc0403457c2f067
6
+ metadata.gz: dc648d2523347f3c35665a6fb9d5b4dd9beb41463aeb6ccc2af821b593307ab23b818ea5dff8e71a54acaad16bd53af28cefa40821002690214f071894a9b14d
7
+ data.tar.gz: 31bf56b4d73b599ff79ce2dde19ecd80de6150ab8bebc17d5a4ab17f0492fac32b671a80a30dbfb003e4c422de61a9ebea6cd5bf6602c7764a8e4e0b54e30003
data/Gemfile CHANGED
@@ -2,9 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in rake-delphi.gemspec
4
4
  gemspec
5
- gem 'rake', '~> 10.0.4'
6
- gem 'minitest', '~> 4.3'
7
- gem 'xml-simple'
8
- gem 'rubyzip', '~> 0.9.9'
9
- gem 'inifile'
10
- gem 'apktools', :group => :development
data/Gemfile.lock CHANGED
@@ -1,7 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake-delphi (0.0.29)
4
+ rake-delphi (0.0.30)
5
+ bundler (~> 1.3)
6
+ inifile
7
+ rake (~> 10.0.4)
8
+ xml-simple
5
9
 
6
10
  GEM
7
11
  remote: https://rubygems.org/
@@ -19,10 +23,6 @@ PLATFORMS
19
23
 
20
24
  DEPENDENCIES
21
25
  apktools
22
- bundler (~> 1.3)
23
- inifile
24
26
  minitest (~> 4.3)
25
- rake (~> 10.0.4)
26
27
  rake-delphi!
27
28
  rubyzip (~> 0.9.9)
28
- xml-simple
@@ -11,6 +11,7 @@ module Rake
11
11
  def initialize(name, app)
12
12
  super
13
13
  @original_dir = ENV['RAKE_DIR'] || Rake.original_dir
14
+ @libs = []
14
15
  end
15
16
 
16
17
  def self.define(name, app)
@@ -318,7 +318,10 @@ module Rake
318
318
  # on Windows there is some limit on command line parameters length
319
319
  # so we just append path parameters to config file
320
320
  File.open(cfg, 'a+') do |f|
321
- paths.each do |p|
321
+ lpaths = paths
322
+ Logger.trace(Logger::TRACE, 'Implicit and included paths:')
323
+ Logger.trace(Logger::TRACE, lpaths)
324
+ lpaths.each do |p|
322
325
  f.write(p + "\n")
323
326
  end
324
327
  end
@@ -18,7 +18,7 @@ module Rake
18
18
  super
19
19
  initvars
20
20
  @dcc = application.define_task(Dcc32Task, shortname + ':dcc32')
21
- @libs = LibsTask.define(name + ':all-delphi-libs', application)
21
+ @libs = LibsTask.define(shortname + ':all-delphi-libs', application)
22
22
  @post = application.define_task(PAClientTask, @dcc.shortname + ':post')
23
23
  @level = 1
24
24
  enhance([@libs, @dcc, @post])
@@ -25,7 +25,7 @@ module Rake
25
25
  end
26
26
 
27
27
  def method_missing(name, *args, &block)
28
- @info[name]
28
+ @info[name].gsub('"', '""') if @info[name]
29
29
  end
30
30
  end
31
31
 
@@ -63,8 +63,10 @@ module Rake
63
63
  def method_missing(name, *args, &block)
64
64
  if args.empty? && @extra[name]
65
65
  @extra[name]
66
- elsif
67
- @source.name
66
+ elsif @source
67
+ @source.name
68
+ else
69
+ raise 'No key :%s' % name.to_s
68
70
  end
69
71
  end
70
72
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rake
4
4
  module Delphi
5
- VERSION = '0.0.29'
5
+ VERSION = '0.0.30'
6
6
  end
7
7
  end
@@ -37,6 +37,16 @@ module Gem
37
37
  self.class.new segments.join('.')
38
38
  end
39
39
 
40
+ ##
41
+ # The build number
42
+ def build_num
43
+ segments = self.segments.dup
44
+ segments.pop while segments.any? { |s| String === s }
45
+ segments.pop while segments.size > 4
46
+
47
+ segments.size == 4 ? segments[-1] : nil
48
+ end
49
+
40
50
  ##
41
51
  # Returns release only part
42
52
  # (e.g. 1.2.3.4 -> 3, 1.2.3 -> 2)
@@ -48,6 +58,22 @@ module Gem
48
58
  segments[-1]
49
59
  end
50
60
 
61
+ def major
62
+ segments = self.segments.dup
63
+ segments.pop while segments.any? { |s| String === s }
64
+ segments.pop while segments.size > 1
65
+
66
+ segments[-1]
67
+ end
68
+
69
+ def minor
70
+ segments = self.segments.dup
71
+ segments.pop while segments.any? { |s| String === s }
72
+ segments.pop while segments.size > 2
73
+
74
+ segments.size == 2 ? segments[-1] : nil
75
+ end
76
+
51
77
  def comma
52
78
  segments.dup.join(',')
53
79
  end
@@ -9,7 +9,7 @@ if defined? MiniTest::Unit::TestCase && Test::Unit::TestCase < MiniTest::Unit::T
9
9
  class TestCase
10
10
  def name
11
11
  __name__
12
- end
12
+ end unless instance_methods.include?(:name)
13
13
  end
14
14
  end
15
15
  end
data/rake-delphi.gemspec CHANGED
@@ -28,10 +28,15 @@ Gem::Specification.new do |spec|
28
28
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_development_dependency "bundler", "~> 1.3"
31
+ spec.add_runtime_dependency "bundler", "~> 1.3"
32
+ spec.add_runtime_dependency "rake", "~> 10.0.4"
33
+ spec.add_runtime_dependency "xml-simple"
34
+ spec.add_runtime_dependency "inifile"
35
+ # Ruby 2.2 have no `test-unit` gem in stdlib
36
+ if (Gem::Version.new(RUBY_VERSION) <=> Gem::Version.new('2.2')) >= 0
37
+ spec.add_development_dependency "test-unit"
38
+ end
32
39
  spec.add_development_dependency "minitest", "~> 4.3"
33
- spec.add_development_dependency "rake", "~> 10.0.4"
34
- spec.add_development_dependency "xml-simple"
35
40
  spec.add_development_dependency "rubyzip", "~> 0.9.9"
36
41
  spec.add_development_dependency "apktools"
37
42
  end
data/test/test-delphi.rb CHANGED
@@ -16,7 +16,7 @@ module DelphiTests
16
16
 
17
17
  class TestDelphi < TestVerInfo
18
18
  private
19
- def _test_compile_and_output(prepare_args, output)
19
+ def _test_prepare(prepare_args)
20
20
  args = [:altercfg, :usecfg, :defines, :debuginfo, :debug, :includepaths]
21
21
  # reinitialize arguments (even absent ones)
22
22
  args.each do |arg|
@@ -39,7 +39,10 @@ private
39
39
  prepare_args[:dcu] = dcu_dir_rel.unix2dos_separator
40
40
 
41
41
  prepare_task.invoke(useresources, prepare_args)
42
+ end
42
43
 
44
+ def _test_compile_and_output(prepare_args, output)
45
+ _test_prepare(prepare_args)
43
46
  # reenable tasks (!!! after invoking 'test:prepare')
44
47
  task = ::Rake::Task['test:compile']
45
48
  task.reenable_chain
@@ -66,6 +69,13 @@ public
66
69
  require PROJECT_PATH + '/Rakefile.rb'
67
70
  end
68
71
 
72
+ def test_all_delphi_libs_task_name
73
+ namespace :test_name do
74
+ Rake.application.define_task(Rake::Delphi::Project, :'project:delphi')
75
+ end
76
+ assert_equal 'test_name:project:delphi:all-delphi-libs', ::Rake::Task['test_name:project:delphi:all-delphi-libs'].name
77
+ end
78
+
69
79
  def test_compile
70
80
  _test_compile_and_output({},
71
81
  'testproject works')
@@ -32,6 +32,17 @@ public
32
32
  assert_equal '1,2,3,4', Gem::VersionImproved.new('1.2.3.4').comma
33
33
  end
34
34
 
35
+ def test_build_num
36
+ @version = Gem::VersionImproved.new('1.2.3.4')
37
+ assert_equal 4, @version.build_num
38
+
39
+ @version = Gem::VersionImproved.new('1.2.3')
40
+ assert_equal nil, @version.build_num
41
+
42
+ @version = Gem::VersionImproved.new('1.2')
43
+ assert_equal nil, @version.build_num
44
+ end
45
+
35
46
  def test_release_num
36
47
  @version = Gem::VersionImproved.new('1.2.3.4')
37
48
  assert_equal 3, @version.release_num
@@ -73,4 +84,32 @@ public
73
84
  @version = Gem::VersionImproved.new('1.x')
74
85
  assert_equal '2', @version.build.version
75
86
  end
87
+
88
+ def test_major
89
+ @version = Gem::VersionImproved.new('1.2.3.4')
90
+ assert_equal 1, @version.major
91
+
92
+ @version = Gem::VersionImproved.new('5.2.3')
93
+ assert_equal 5, @version.major
94
+
95
+ @version = Gem::VersionImproved.new('3.2')
96
+ assert_equal 3, @version.major
97
+
98
+ @version = Gem::VersionImproved.new('4')
99
+ assert_equal 4, @version.major
100
+ end
101
+
102
+ def test_minor
103
+ @version = Gem::VersionImproved.new('1.2.3.4')
104
+ assert_equal 2, @version.minor
105
+
106
+ @version = Gem::VersionImproved.new('5.4.3')
107
+ assert_equal 4, @version.minor
108
+
109
+ @version = Gem::VersionImproved.new('3.1')
110
+ assert_equal 1, @version.minor
111
+
112
+ @version = Gem::VersionImproved.new('4')
113
+ assert_equal nil, @version.minor
114
+ end
76
115
  end
@@ -28,6 +28,13 @@ public
28
28
  end
29
29
  # already invoked
30
30
  assert_not_equal(nil, task2.libs)
31
+ # not empty
32
+ assert_not_equal([], task2.libs)
33
+ end
34
+
35
+ def test_libs_relative_not_executed
36
+ task2 = Rake::Delphi::LibsTask.define('libs task not executed', Rake.application)
37
+ assert_equal [], task2.libs
31
38
  end
32
39
 
33
40
  def test_libs_relative
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-delphi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Shumkin
@@ -17,7 +17,7 @@ dependencies:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
- type: :development
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
@@ -25,47 +25,61 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
- name: minitest
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '4.3'
34
- type: :development
33
+ version: 10.0.4
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: '4.3'
40
+ version: 10.0.4
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: xml-simple
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
- version: 10.0.4
48
- type: :development
47
+ version: '0'
48
+ type: :runtime
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: 10.0.4
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: xml-simple
56
+ name: inifile
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- type: :development
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
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '4.3'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '4.3'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rubyzip
71
85
  requirement: !ruby/object:Gem::Requirement