ib 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/ib.gemspec +2 -2
- data/lib/ib/generator.rb +2 -2
- data/lib/ib/parser.rb +5 -2
- data/lib/ib/project.rb +23 -25
- data/lib/ib/version.rb +1 -1
- data/spec/spec_helper.rb +16 -0
- metadata +27 -27
data/README.md
CHANGED
@@ -123,7 +123,7 @@ Here is [sample app](https://github.com/yury/ibsample)
|
|
123
123
|
3. run `rake ib:open` to change story board
|
124
124
|
4. run `rake` to run app in simulator
|
125
125
|
|
126
|
-
**Note** : this app is build for iOS 6.0
|
126
|
+
**Note** : this app is build for iOS 6.0
|
127
127
|
|
128
128
|
## Contributing
|
129
129
|
|
data/ib.gemspec
CHANGED
@@ -15,8 +15,8 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = IB::VERSION
|
17
17
|
|
18
|
-
gem.add_dependency "xcodeproj", ">= 0.
|
19
|
-
gem.add_dependency "thor", "
|
18
|
+
gem.add_dependency "xcodeproj", ">= 0.4.0"
|
19
|
+
gem.add_dependency "thor", ">= 0.15.4"
|
20
20
|
|
21
21
|
gem.add_development_dependency "rspec", ">= 2.0"
|
22
22
|
end
|
data/lib/ib/generator.rb
CHANGED
data/lib/ib/parser.rb
CHANGED
@@ -7,9 +7,12 @@ class IB::Parser
|
|
7
7
|
METHOD_DEF_REGEX = /^[ \t]+(def)[ \t](#{NAME_REGEX})([ \t(]+)?(#{NAME_REGEX})?([ \t)]*)(#.*)?$/
|
8
8
|
ACTION_REGEX = Regexp.union METHOD_DEF_REGEX, METHOD_REF_REGEX
|
9
9
|
|
10
|
-
def find_all(
|
10
|
+
def find_all(dir_or_files)
|
11
11
|
all = {}
|
12
|
-
|
12
|
+
files = dir_or_files
|
13
|
+
files = Dir.glob("#{dir_or_files}/**/*.rb").to_a if dir_or_files.class == String
|
14
|
+
|
15
|
+
files.each do |file|
|
13
16
|
if info = find(file)
|
14
17
|
all[file] = info
|
15
18
|
end
|
data/lib/ib/project.rb
CHANGED
@@ -1,45 +1,43 @@
|
|
1
1
|
class IB::Project
|
2
2
|
def write app_path = "app", resources_path = "resources", pods_headers_path = "vendor/Pods/Headers"
|
3
3
|
project = Xcodeproj::Project.new
|
4
|
-
target = project.
|
4
|
+
target = project.new_target(:static_library, 'ib', :ios)
|
5
5
|
|
6
|
-
resources = project.
|
7
|
-
|
8
|
-
pods = project.groups.new('name' => 'Pods')
|
6
|
+
resources = project.new_group("Resources")
|
7
|
+
resources.path = resources_path
|
9
8
|
|
10
|
-
|
11
|
-
support.
|
9
|
+
support = project.new_group("Supporting Files")
|
10
|
+
support.path = "ib.xcodeproj"
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
pods = project.new_group("Pods")
|
13
|
+
pods.path = pods_headers_path
|
14
|
+
|
15
|
+
IB::Generator.new.write(Motion::Project::App.config.files, "ib.xcodeproj")
|
16
|
+
|
17
|
+
support.new_file "ib.xcodeproj/Stubs.h"
|
18
|
+
file = support.new_file "ib.xcodeproj/Stubs.m"
|
19
|
+
target.add_file_references([ file ])
|
18
20
|
|
19
21
|
resource_exts = %W{xcdatamodeld png jpg jpeg storyboard xib lproj}
|
20
22
|
Dir.glob("#{resources_path}/**/*.{#{resource_exts.join(",")}}") do |file|
|
21
|
-
file = file.gsub(/^#{resources_path}\//, '')
|
22
23
|
if file.end_with? ".xcdatamodeld"
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
relative_file_path = file.split("/").last
|
25
|
+
obj = resources.new_xcdatamodel_group(relative_file_path)
|
26
|
+
internal_file = obj.files.first
|
27
|
+
internal_file.path = relative_file_path.gsub(/xcdatamodeld$/, 'xcdatamodel')
|
28
|
+
internal_file.source_tree = "<group>"
|
29
|
+
resources.children << obj
|
26
30
|
else
|
27
|
-
resources.
|
31
|
+
resources.new_file(file)
|
28
32
|
end
|
29
33
|
end
|
30
34
|
|
31
35
|
Dir.glob("#{pods_headers_path}/**/*.h") do |file|
|
32
|
-
pods.
|
36
|
+
pods.new_file(file)
|
33
37
|
end
|
34
38
|
|
35
|
-
|
36
|
-
|
37
|
-
# doesn't work with UIKit
|
38
|
-
|
39
|
-
frameworks = ["QuartzCore", "CoreGraphics", "CoreData"]
|
40
|
-
frameworks.each do |framework|
|
41
|
-
file = project.add_system_framework framework
|
42
|
-
target.frameworks_build_phases.first << file
|
39
|
+
%W{QuartzCore CoreGraphics CoreData}.each do |framework|
|
40
|
+
project.add_system_framework framework
|
43
41
|
end
|
44
42
|
|
45
43
|
project.save_as("ib.xcodeproj")
|
data/lib/ib/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -5,6 +5,22 @@
|
|
5
5
|
|
6
6
|
require 'ib'
|
7
7
|
|
8
|
+
module Motion
|
9
|
+
class Config
|
10
|
+
def self.files
|
11
|
+
[]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
module Project
|
16
|
+
class App
|
17
|
+
def self.config
|
18
|
+
Motion::Config
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
8
24
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
9
25
|
RSpec.configure do |config|
|
10
26
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.1
|
5
4
|
prerelease:
|
5
|
+
version: 0.2.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Yury Korolev
|
@@ -10,56 +10,56 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-12-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ! '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 0.4.0
|
21
|
+
none: false
|
22
|
+
prerelease: false
|
16
23
|
name: xcodeproj
|
17
24
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
25
|
requirements:
|
20
26
|
- - ! '>='
|
21
27
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
28
|
+
version: 0.4.0
|
29
|
+
none: false
|
23
30
|
type: :runtime
|
24
|
-
|
31
|
+
- !ruby/object:Gem::Dependency
|
25
32
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
33
|
requirements:
|
28
34
|
- - ! '>='
|
29
35
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0.
|
31
|
-
|
36
|
+
version: 0.15.4
|
37
|
+
none: false
|
38
|
+
prerelease: false
|
32
39
|
name: thor
|
33
40
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
41
|
requirements:
|
36
|
-
- -
|
42
|
+
- - ! '>='
|
37
43
|
- !ruby/object:Gem::Version
|
38
44
|
version: 0.15.4
|
39
|
-
type: :runtime
|
40
|
-
prerelease: false
|
41
|
-
version_requirements: !ruby/object:Gem::Requirement
|
42
45
|
none: false
|
43
|
-
|
44
|
-
- - ~>
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 0.15.4
|
46
|
+
type: :runtime
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
48
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
49
|
requirements:
|
52
50
|
- - ! '>='
|
53
51
|
- !ruby/object:Gem::Version
|
54
52
|
version: '2.0'
|
55
|
-
type: :development
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: !ruby/object:Gem::Requirement
|
58
53
|
none: false
|
54
|
+
prerelease: false
|
55
|
+
name: rspec
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
59
57
|
requirements:
|
60
58
|
- - ! '>='
|
61
59
|
- !ruby/object:Gem::Version
|
62
60
|
version: '2.0'
|
61
|
+
none: false
|
62
|
+
type: :development
|
63
63
|
description: Magic rubymotion ib outlets support
|
64
64
|
email:
|
65
65
|
- yury.korolev@gmail.com
|
@@ -101,23 +101,23 @@ rdoc_options: []
|
|
101
101
|
require_paths:
|
102
102
|
- lib
|
103
103
|
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
-
none: false
|
105
104
|
requirements:
|
106
105
|
- - ! '>='
|
107
106
|
- !ruby/object:Gem::Version
|
108
107
|
version: '0'
|
109
108
|
segments:
|
110
109
|
- 0
|
111
|
-
hash: -
|
112
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
hash: -2351586432581253994
|
113
111
|
none: false
|
112
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
113
|
requirements:
|
115
114
|
- - ! '>='
|
116
115
|
- !ruby/object:Gem::Version
|
117
116
|
version: '0'
|
118
117
|
segments:
|
119
118
|
- 0
|
120
|
-
hash: -
|
119
|
+
hash: -2351586432581253994
|
120
|
+
none: false
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project:
|
123
123
|
rubygems_version: 1.8.24
|