zewo-dev 0.2.9 → 0.2.10

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: 7403c6b926202e7bc02eae2995f9cfe76e1b4e88
4
- data.tar.gz: a1c384428305425517031772c7c37bc0095c1ab7
3
+ metadata.gz: ce2e8f7965bec2557174aea4f424d029c4f06f1e
4
+ data.tar.gz: ae678c512b08643a3995d3fd4a971e1c20293cfb
5
5
  SHA512:
6
- metadata.gz: 3840e573f9d56bb2f8ac732dccbd84846f2ca337c9069ddddb9a8809765ce0b45c3aaeaa07d3e366dc20669255e3a1223d0b82465a0f3e5ee447eebd61f9c1a1
7
- data.tar.gz: 99c9dac1da147e72d30ea426523378bf127274a6331abb5b1c6a5f20eb86cc7067d3999c3694133b9e02627a988de313c705f071e77b8d39864f61e5efce1d83
6
+ metadata.gz: 078cb097ada7fccbba4b24d89e71f1819fa8605b79b6911e52afd52f693357a510d012f652c4c3bf153584f77d88ccfcc5b2b74e768fb91aa47aa0acba098d7b
7
+ data.tar.gz: 205f0a1f4022773245dea55e09743d0c16976a4c310eba16671fcf494d4fa7506bbb9b22a9eed07ea494dfffb6f9a2f29bb7c46426651f600b44f587569fb4ed
data/README.md CHANGED
@@ -21,6 +21,9 @@ zewodev init
21
21
  ```
22
22
 
23
23
  ## Xcode development
24
+
25
+ > A new method has been implemented to simplify the setup process `zewodev setup_osx_dev`. This command removes the need to perform the steps below.
26
+
24
27
  Run `zewodev make_projects` to generate Xcode projects for all Swift modules. Every time this command is run, the previously generated projects are removed entirely. Xcode files should not be pushed. Add `XcodeDevelopment` to `.gitignore` if not there already.
25
28
 
26
29
  **Because the tool also adds modules as dependencies you can work on several repositories simultaneously.**
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "zewo"
3
+ require 'bundler/setup'
4
+ require 'zewo'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +10,5 @@ require "zewo"
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
- require "irb"
13
+ require 'irb'
14
14
  IRB.start
data/bin/zewodev CHANGED
@@ -1,8 +1,7 @@
1
- #!/usr/bin/env ruby -wU
1
+ #!/usr/bin/env ruby -W0
2
2
 
3
3
  require 'zewo'
4
4
 
5
5
  $VERBOSE = nil
6
6
 
7
7
  Zewo::App.start(ARGV)
8
-
data/lib/zewo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Zewo
2
- VERSION = "0.2.9"
2
+ VERSION = "0.2.10".freeze
3
3
  end
data/lib/zewo.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'zewo/version'
2
2
 
3
3
  require 'thor'
4
- require 'rubygems'
5
4
  require 'json'
6
5
  require 'net/http'
7
6
  require 'uri'
@@ -37,7 +36,6 @@ module Zewo
37
36
  if target_name == 'OS'
38
37
  target_name = 'OperatingSystem'
39
38
  end
40
-
41
39
  xcode_project.native_targets.find { |t| t.name == target_name } || xcode_project.new_target(:framework, target_name, :osx)
42
40
  end
43
41
 
@@ -53,11 +51,11 @@ module Zewo
53
51
  end
54
52
 
55
53
  def tests_dirname
56
- "Tests"
54
+ 'Tests'
57
55
  end
58
56
 
59
57
  def xcode_dirname
60
- "XcodeDevelopment"
58
+ 'XcodeDevelopment'
61
59
  end
62
60
 
63
61
  def xcode_project_path
@@ -65,22 +63,14 @@ module Zewo
65
63
  end
66
64
 
67
65
  def sources_dirname
68
- if File.directory?(dir('Sources'))
69
- return 'Sources'
70
- elsif File.directory?(dir('Source'))
71
- return 'Source'
72
- end
73
- nil
66
+ return 'Sources' if File.directory?(dir('Sources'))
67
+ return 'Source' if File.directory?(dir('Source'))
74
68
  end
75
69
 
76
70
  def xcode_project
77
71
  return @xcodeproj if @xcodeproj
78
- if File.exist?(xcode_project_path)
79
- @xcodeproj = Xcodeproj::Project.open(xcode_project_path)
80
- else
81
- @xcodeproj = Xcodeproj::Project.new(xcode_project_path)
82
- end
83
- @xcodeproj
72
+ return Xcodeproj::Project.open(xcode_project_path) if File.exist?(xcode_project_path)
73
+ Xcodeproj::Project.new(xcode_project_path)
84
74
  end
85
75
 
86
76
  def add_files(direc, current_group, main_target)
@@ -102,22 +92,15 @@ module Zewo
102
92
  def build_dependencies
103
93
  puts "Configuring dependencies for #{name}".green
104
94
  dependency_repos = File.read(dir('Package.swift')).scan(/(?<=Zewo\/|SwiftX\/|VeniceX\/|paulofaria\/)(.*?)(?=\.git)/).map(&:first)
105
-
106
- # here we should do something like dependency_repos -= ['CMySQL', 'COpenSSL', 'CLibpq']
107
-
108
95
  group = xcode_project.new_group('Subprojects')
109
96
  dependency_repos.each do |repo_name|
110
97
  next if repo_name.end_with?('-OSX')
111
98
 
112
99
  repo = Repo.new(repo_name)
113
- project_reference = group.new_file("#{repo.xcode_project_path}")
100
+ project_reference = group.new_file(repo.xcode_project_path.to_s)
114
101
  project_reference.path = "../../#{project_reference.path}"
115
-
116
- if framework_target
117
- framework_target.add_dependency(repo.framework_target)
118
- end
102
+ framework_target.add_dependency(repo.framework_target) if framework_target
119
103
  end
120
-
121
104
  xcode_project.save
122
105
  end
123
106
 
@@ -161,7 +144,7 @@ module Zewo
161
144
 
162
145
  xcode_project.save
163
146
 
164
- scheme = Xcodeproj::XCScheme.new()
147
+ scheme = Xcodeproj::XCScheme.new
165
148
  scheme.configure_with_targets(framework_target, test_target)
166
149
  scheme.test_action.code_coverage_enabled = true
167
150
  scheme.save_as(xcode_project.path, framework_target.name, true)
@@ -176,12 +159,9 @@ module Zewo
176
159
  http.use_ssl = true
177
160
  request = Net::HTTP::Get.new(uri.request_uri)
178
161
 
179
- blacklist = [
180
- 'ZeroMQ'
181
- ]
162
+ blacklist = ['ZeroMQ']
182
163
 
183
164
  response = http.request(request)
184
-
185
165
  if response.code == '200'
186
166
  result = JSON.parse(response.body).sort_by { |hsh| hsh['name'] }
187
167
 
@@ -207,9 +187,7 @@ module Zewo
207
187
 
208
188
  def each_code_repo
209
189
  each_repo do |repo|
210
- unless File.exist?(repo.dir('Package.swift'))
211
- next
212
- end
190
+ next unless File.exist?(repo.dir('Package.swift'))
213
191
  yield repo
214
192
  end
215
193
  end
@@ -227,7 +205,7 @@ module Zewo
227
205
  def verify_branches
228
206
  last_branch_name = nil
229
207
  each_repo do |repo|
230
- branch_name = `cd #{repo.dir}; git rev-parse --abbrev-ref HEAD`.gsub("\n", '')
208
+ branch_name = `cd #{repo.dir}; git rev-parse --abbrev-ref HEAD`.delete("\n")
231
209
  if !last_branch_name.nil? && branch_name != last_branch_name
232
210
  puts "Branch mismatch. Branch of #{repo.name} does not match previous branch #{branch_name}".red
233
211
  return false
@@ -240,11 +218,7 @@ module Zewo
240
218
  def prompt(question)
241
219
  printf "#{question} - y/N: "
242
220
  p = STDIN.gets.chomp
243
- if p == 'y'
244
- true
245
- else
246
- false
247
- end
221
+ p == 'y'
248
222
  end
249
223
 
250
224
  def uncommited_changes?(repo_name)
@@ -252,7 +226,7 @@ module Zewo
252
226
  end
253
227
 
254
228
  def master_branch?(repo_name)
255
- name = `cd #{repo_name}; git rev-parse --abbrev-ref HEAD`
229
+ `cd #{repo_name}; git rev-parse --abbrev-ref HEAD`
256
230
  end
257
231
 
258
232
  def each_osx_whitelisted_repo
@@ -296,23 +270,18 @@ module Zewo
296
270
  def status
297
271
  each_code_repo do |repo|
298
272
  str = repo.name
299
- if uncommited_changes?(repo.name)
300
- str = str.red
301
- else
302
- str = str.green
303
- end
304
-
273
+ str = uncommited_changes?(repo.name) ? str.red : str.green
305
274
  tag = `cd #{repo.name}; git describe --abbrev=0 --tags` || 'No tag'
306
275
  str += " (#{tag})"
307
- puts str.gsub("\n", '')
276
+ puts str.delete("\n")
308
277
  end
309
278
  end
310
279
 
311
280
  desc :tag, 'Tags all code repositories with the given tag. Asks to confirm for each repository'
312
281
  def tag(tag)
313
282
  each_code_repo do |repo|
314
- shouldTag = prompt("create tag #{tag} in #{repo.name}?")
315
- if shouldTag
283
+ should_tag = prompt("create tag #{tag} in #{repo.name}?")
284
+ if should_tag
316
285
  silent_cmd("cd #{repo.name} && git tag #{tag}")
317
286
  puts repo.name.green
318
287
  end
@@ -322,7 +291,7 @@ module Zewo
322
291
  desc :checkout, 'Checks out all code repositories to the latest patch release for the given tag/branch'
323
292
  option :branch
324
293
  option :tag
325
- def checkout()
294
+ def checkout
326
295
  if !options[:branch] && !options[:tag]
327
296
  puts 'Need to specify either --tag or --branch'.red
328
297
  return
@@ -330,18 +299,11 @@ module Zewo
330
299
 
331
300
  Dir['*/'].each do |folder_name|
332
301
  folder_name = folder_name[0...-1]
333
- matched = nil
334
-
335
- if options[:tag]
336
- matched = `cd #{folder_name} && git tag`
337
- .split("\n")
338
- .select { |t| t.start_with?(options[:tag]) }
339
- .last
340
- end
341
-
342
- if options[:branch]
343
- matched = options[:branch]
344
- end
302
+ matched = `cd #{repo.name} && git tag`
303
+ .split("\n")
304
+ .select { |t| t.start_with?(options[:tag]) }
305
+ .last if options[:tag]
306
+ matched = options[:branch] if options[:branch]
345
307
 
346
308
  if matched
347
309
  silent_cmd("cd #{folder_name} && git checkout #{matched}")
@@ -354,7 +316,7 @@ module Zewo
354
316
 
355
317
  desc :pull, 'git pull on all repos'
356
318
  def pull
357
- print "Updating all repositories..." + "\n"
319
+ print "Updating all repositories...\n"
358
320
  each_code_repo_async do |repo|
359
321
  if uncommited_changes?(repo.name)
360
322
  print "Uncommitted changes in #{repo.name}. Not updating.".red + "\n"
@@ -368,7 +330,6 @@ module Zewo
368
330
  desc :make_projects, 'Makes Xcode projects for all modules'
369
331
  def make_projects
370
332
  each_code_repo(&:configure_xcode_project)
371
-
372
333
  each_code_repo(&:build_dependencies)
373
334
  end
374
335
 
data/zewo.gemspec CHANGED
@@ -4,27 +4,25 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'zewo/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "zewo-dev"
7
+ spec.name = 'zewo-dev'
8
8
  spec.version = Zewo::VERSION
9
- spec.authors = ["David Ask"]
10
- spec.email = ["david@formbound.com"]
9
+ spec.authors = ['David Ask']
10
+ spec.email = ['david@formbound.com']
11
11
 
12
- spec.summary = %q{Summary}
13
- spec.description = %q{Description}
14
- spec.homepage = "http://github.com/Zewo"
15
- spec.license = "MIT"
12
+ spec.summary = 'zewo-dev is a tool to make developing Zewo modules and tracking their status easier.'
13
+ spec.description = 'Developer tool for contributing to Zewo'
14
+ spec.homepage = 'http://github.com/Zewo'
15
+ spec.license = 'MIT'
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0")
18
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
- spec.require_paths = ["lib"]
19
+ spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency "xcodeproj", "~> 0.28"
22
- spec.add_dependency "thor", "~> 0.19"
23
- spec.add_dependency "xcpretty", "~> 0.2"
24
- spec.add_dependency "colorize"
25
-
26
-
21
+ spec.add_runtime_dependency 'xcodeproj', '~> 0.28.2'
22
+ spec.add_runtime_dependency 'thor', '~> 0.19'
23
+ spec.add_runtime_dependency 'xcpretty', '~> 0.2'
24
+ spec.add_runtime_dependency 'colorize', '~> 0'
27
25
 
28
- spec.add_development_dependency "bundler", "~> 1.10"
29
- spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency 'bundler', '~> 1.10'
27
+ spec.add_development_dependency 'rake', '~> 10.0'
30
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zewo-dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Ask
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-29 00:00:00.000000000 Z
11
+ date: 2016-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.28'
19
+ version: 0.28.2
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
- version: '0.28'
26
+ version: 0.28.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -56,14 +56,14 @@ dependencies:
56
56
  name: colorize
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
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
69
  - !ruby/object:Gem::Dependency
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '10.0'
97
- description: Description
97
+ description: Developer tool for contributing to Zewo
98
98
  email:
99
99
  - david@formbound.com
100
100
  executables:
@@ -137,8 +137,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  requirements: []
139
139
  rubyforge_project:
140
- rubygems_version: 2.4.8
140
+ rubygems_version: 2.2.2
141
141
  signing_key:
142
142
  specification_version: 4
143
- summary: Summary
143
+ summary: zewo-dev is a tool to make developing Zewo modules and tracking their status
144
+ easier.
144
145
  test_files: []