objc 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/objc +35 -5
- data/lib/objc.rb +2 -2
- data/lib/objc/version.rb +1 -1
- data/lib/objc/xcode_project.rb +15 -2
- data/objc.gemspec +2 -1
- metadata +28 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c76582912afd3763e1fe94bff4a215d35de141ca
|
4
|
+
data.tar.gz: ea26686f0f6c15a3827b9593aed32da129bd88f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f38efdb80c7cd4ddd1f98f9c3cf484684df600dfe2195569dd8f6914dff4a694edc1321fa821ddf703063b8b9741a9f35011a6b64097298c7e3547a5dbcbc927
|
7
|
+
data.tar.gz: e8d02cabdf451e7f26c3020c11609eb2b79519aa02be6eff2d5deb0c38ac2ce8168379f1185b8dd0a0badbc6d80e6d427e66e50e8c446e2b81d579c6f8efccbc
|
data/bin/objc
CHANGED
@@ -2,12 +2,13 @@
|
|
2
2
|
|
3
3
|
path = __FILE__
|
4
4
|
$:.unshift(File.join(File.dirname(File.expand_path(path)), '..', 'lib'))
|
5
|
+
|
5
6
|
require 'objc'
|
7
|
+
require 'optparse'
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
puts %{
|
9
|
+
def usage
|
10
|
+
<<-TXT.sub(/^\s+/, '')
|
11
|
+
Usage: objc [options] FILE_PREFIX
|
11
12
|
|
12
13
|
The `objc` binary requires that you provide a file prefix so that it is
|
13
14
|
able to find the: header file; source file; and test file.
|
@@ -15,5 +16,34 @@ else
|
|
15
16
|
$ objc Anagram
|
16
17
|
|
17
18
|
This will find the following: Anagram.h; Anagram.m; and AnagramTest.m
|
18
|
-
|
19
|
+
TXT
|
20
|
+
end
|
21
|
+
|
22
|
+
options = { runner: :xctool }
|
23
|
+
|
24
|
+
OptionParser.new do |opts|
|
25
|
+
opts.banner = usage
|
26
|
+
opts.separator ""
|
27
|
+
opts.separator "Specific options:"
|
28
|
+
|
29
|
+
opts.on("-x", "--xcodebuild", "Use xcodebuild") do
|
30
|
+
options[:runner] = :xcodebuild
|
31
|
+
end
|
32
|
+
|
33
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
34
|
+
puts opts
|
35
|
+
exit
|
36
|
+
end
|
37
|
+
|
38
|
+
opts.on_tail("--version", "Show version") do
|
39
|
+
puts Objc::VERSION
|
40
|
+
exit
|
41
|
+
end
|
42
|
+
end.parse!
|
43
|
+
|
44
|
+
if ARGV.count == 1
|
45
|
+
Objc::Test.with(ARGV[0], runner: options[:runner])
|
46
|
+
else
|
47
|
+
system("objc --help")
|
48
|
+
exit
|
19
49
|
end
|
data/lib/objc.rb
CHANGED
@@ -9,12 +9,12 @@ module Objc
|
|
9
9
|
module Test
|
10
10
|
extend self
|
11
11
|
|
12
|
-
def with(filePrefix)
|
12
|
+
def with(filePrefix, runner: :xctool)
|
13
13
|
puts "Looking for all files with prefix: #{filePrefix}"
|
14
14
|
|
15
15
|
files = SourceFiles.new(filePrefix)
|
16
16
|
|
17
|
-
project = XcodeProject.new
|
17
|
+
project = XcodeProject.new(runner)
|
18
18
|
project.install!
|
19
19
|
project.add(files)
|
20
20
|
project.execute!
|
data/lib/objc/version.rb
CHANGED
data/lib/objc/xcode_project.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
module Objc
|
2
2
|
module Test
|
3
3
|
class XcodeProject
|
4
|
+
attr_reader :runner
|
5
|
+
|
6
|
+
def initialize(runner)
|
7
|
+
@runner = runner
|
8
|
+
end
|
4
9
|
|
5
10
|
def install!
|
6
11
|
clean
|
@@ -74,9 +79,17 @@ module Objc
|
|
74
79
|
'test-suite'
|
75
80
|
end
|
76
81
|
|
82
|
+
def use_xcodebuild?
|
83
|
+
runner == :xcodebuild
|
84
|
+
end
|
85
|
+
|
77
86
|
def xctool_command
|
78
|
-
|
87
|
+
if use_xcodebuild?
|
88
|
+
"xcodebuild -project #{project_path} -scheme IgnoreThisTarget test | xcpretty"
|
89
|
+
else
|
90
|
+
"xctool -project #{project_path} -scheme IgnoreThisTarget test"
|
91
|
+
end
|
79
92
|
end
|
80
93
|
end
|
81
94
|
end
|
82
|
-
end
|
95
|
+
end
|
data/objc.gemspec
CHANGED
@@ -21,8 +21,9 @@ execution of a test suite without the hassle of managing an Xcode Project File}
|
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
23
|
spec.add_dependency "xcoder", "~> 0.1.15"
|
24
|
+
spec.add_dependency "xcpretty", "~> 0.2.6"
|
24
25
|
|
25
26
|
spec.add_development_dependency "bundler", "~> 1.3"
|
26
|
-
spec.add_development_dependency "rake"
|
27
|
+
spec.add_development_dependency "rake", "~> 11.2"
|
27
28
|
|
28
29
|
end
|
metadata
CHANGED
@@ -1,57 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: objc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franklin Webber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcoder
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.1.15
|
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
26
|
version: 0.1.15
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: xcpretty
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.2.6
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.2.6
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- - ~>
|
45
|
+
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
47
|
version: '1.3'
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- - ~>
|
52
|
+
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '1.3'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- -
|
59
|
+
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
61
|
+
version: '11.2'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- -
|
66
|
+
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
68
|
+
version: '11.2'
|
55
69
|
description: |-
|
56
70
|
This gem is a test suite runner for Objective-C files to allow for the easy
|
57
71
|
execution of a test suite without the hassle of managing an Xcode Project File. This allows you to work on your source files outside of a Xcode project but still have them tested. This is useful when when you want to practice Objective-C without the hassle of Xcode.
|
@@ -62,7 +76,7 @@ executables:
|
|
62
76
|
extensions: []
|
63
77
|
extra_rdoc_files: []
|
64
78
|
files:
|
65
|
-
- .gitignore
|
79
|
+
- ".gitignore"
|
66
80
|
- Gemfile
|
67
81
|
- LICENSE.txt
|
68
82
|
- README.md
|
@@ -84,17 +98,17 @@ require_paths:
|
|
84
98
|
- lib
|
85
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- -
|
101
|
+
- - ">="
|
88
102
|
- !ruby/object:Gem::Version
|
89
103
|
version: '0'
|
90
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
105
|
requirements:
|
92
|
-
- -
|
106
|
+
- - ">="
|
93
107
|
- !ruby/object:Gem::Version
|
94
108
|
version: '0'
|
95
109
|
requirements: []
|
96
110
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.1
|
111
|
+
rubygems_version: 2.5.1
|
98
112
|
signing_key:
|
99
113
|
specification_version: 4
|
100
114
|
summary: This gem is a test suite runner for Objective-C files to allow for the easy
|