yolo 1.1.18 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ require 'yolo'
3
+ require 'optparse'
4
+
5
+ #if ARGV[0] == "install"
6
+ # Yolo::Config::Install.run
7
+ #end
8
+
9
+ @opt_parser = OptionParser.new do |opts|
10
+ opts.banner = "Usage: yolo COMMAND"
11
+ opts.separator ""
12
+ opts.separator "Commands"
13
+ opts.separator " install: creates a default yolo Rakefile in the current directory"
14
+
15
+ opts.on("-h","--help","help") do
16
+ puts @opt_parser
17
+ end
18
+ end
19
+
20
+ @opt_parser.parse ARGV
21
+
22
+ case ARGV[0]
23
+ when "install"
24
+ Yolo::Config::Install.run
25
+ else
26
+ puts @opt_parser
27
+ end
@@ -9,3 +9,4 @@ module Yolo
9
9
  end
10
10
 
11
11
  require 'yolo/config/settings'
12
+ require 'yolo/config/install'
@@ -0,0 +1,50 @@
1
+ require 'fileutils'
2
+ require 'yolo/formatters'
3
+
4
+ module Yolo
5
+ module Config
6
+ #
7
+ # The Install class provides a number of methods to install yolo into projects
8
+ #
9
+ # @author [Alex Fish]
10
+ #
11
+ class Install
12
+
13
+ #
14
+ # Runs the yolo project install
15
+ #
16
+ def self.run
17
+ self.move_rakefile
18
+ self.rename_rakefile
19
+ `open Rakefile`
20
+ Yolo::Formatters::ProgressFormatter.new.rakefile_created(Dir.pwd + "/Rakefile")
21
+ end
22
+
23
+ private
24
+
25
+ #
26
+ # Moves the default rakefile into the current directory
27
+ #
28
+ def self.move_rakefile
29
+ FileUtils.cp_r(self.rakefile, Dir.pwd)
30
+ end
31
+
32
+ #
33
+ # The path to the default rake file
34
+ #
35
+ # @return [String] The full path to the default rakefile
36
+ def self.rakefile
37
+ File.dirname(__FILE__) + "/yolo-Rakefile"
38
+ end
39
+
40
+ #
41
+ # Renames the default rakefile removing the yolo- prefix
42
+ #
43
+ def self.rename_rakefile
44
+ FileUtils.mv(Dir.pwd + '/yolo-Rakefile',Dir.pwd + '/Rakefile')
45
+ end
46
+
47
+ end
48
+
49
+ end
50
+ end
@@ -0,0 +1,45 @@
1
+ require 'rubygems'
2
+ require 'yolo'
3
+
4
+ #
5
+ # Build Task
6
+ #
7
+ Yolo::Tasks::Ios::Build.new do |t|
8
+ t.workspace = "MyProject.xcworkspace"
9
+ t.scheme = "MyProject"
10
+ end
11
+
12
+ #
13
+ # Release Task
14
+ #
15
+ # Yolo::Tasks::Ios::Release.new do |t|
16
+ # t.workspace = "MyProject.xcworkspace"
17
+ # t.scheme = "MyProject"
18
+ # t.configuration = "Release"
19
+ # end
20
+
21
+ #
22
+ # OCUnit task
23
+ #
24
+ # Yolo::Tasks::Ios::OCUnit.new do |t|
25
+ # t.workspace = "MyProject.xcworkspace"
26
+ # t.scheme = "MyProjectTests"
27
+ # t.test_output = :junit
28
+ # end
29
+
30
+ #
31
+ # Calabash task
32
+ #
33
+ # Yolo::Tasks::Ios::Calabash.new do |t|
34
+ # t.workspace = "MyProject.xcworkspace"
35
+ # t.scheme = "MyProject-cal"
36
+ # t.format = :junit
37
+ # t.output_dir = "example-tests"
38
+ # end
39
+
40
+ #
41
+ # Coverage task
42
+ #
43
+ # Yolo::Tasks::Ios::Coverage.new do |t|
44
+ # t.scheme = "MyProject"
45
+ # end
@@ -17,6 +17,15 @@ module Yolo
17
17
  puts green("Config file created in: #{config}")
18
18
  end
19
19
 
20
+ #
21
+ # Outputs a green string stating that the rakefile was created
22
+ # @param file [String] The path to the rakefile
23
+ #
24
+ # @return [type] [description]
25
+ def rakefile_created(file)
26
+ puts green("Rakefile created: #{file}")
27
+ end
28
+
20
29
  #
21
30
  # Outputs a green string stating that setup is complete
22
31
  #
@@ -22,14 +22,6 @@ module Yolo
22
22
  # Defines available rake tasks
23
23
  #
24
24
  def define
25
- namespace :yolo do
26
- desc "Sets up yolo and moves config into place"
27
- task :setup do
28
- formatter = Yolo::Formatters::ProgressFormatter.new
29
- Yolo::Config::Settings.instance.load_config
30
- formatter.setup_complete
31
- end
32
- end
33
25
  end
34
26
  end
35
27
  end
@@ -32,16 +32,9 @@ module Yolo
32
32
  namespace :yolo do
33
33
  desc "Builds the specified scheme(s)."
34
34
  task :build do
35
- xcodebuild :build
36
- end
37
-
38
- desc "Cleans the specified scheme(s)."
39
- task :clean do
40
35
  xcodebuild :clean
36
+ xcodebuild :build
41
37
  end
42
-
43
- desc "Builds the specified scheme(s) from a clean slate."
44
- task :cleanbuild => [:clean, :build]
45
38
  end
46
39
  end
47
40
  end
@@ -31,22 +31,11 @@ module Yolo
31
31
  namespace :yolo do
32
32
  namespace :calabash do
33
33
  desc "Runs the specified scheme(s) calabash tests."
34
- task :test => :build do
35
- Yolo::Tools::Ios::Calabash.run(format, output_dir)
36
- end
37
-
38
- desc "Cleans the specified scheme(s)."
39
- task :clean do
34
+ task :test do
40
35
  xcodebuild :clean
41
- end
42
-
43
- desc "Builds the specified scheme(s)."
44
- task :build do
45
36
  xcodebuild :build
37
+ Yolo::Tools::Ios::Calabash.run(format, output_dir)
46
38
  end
47
-
48
- desc "Runs the specified scheme(s) calabash tests from a clean slate."
49
- task :cleantest => [:clean, :test]
50
39
  end
51
40
  end
52
41
  end
@@ -44,16 +44,9 @@ module Yolo
44
44
  namespace :ocunit do
45
45
  desc "Runs the specified scheme(s) OCUnit tests."
46
46
  task :test do
47
- xcodebuild :build
48
- end
49
-
50
- desc "Cleans the specified scheme(s)."
51
- task :clean do
52
47
  xcodebuild :clean
48
+ xcodebuild :build
53
49
  end
54
-
55
- desc "Runs the specified scheme(s) OCUnit tests from a clean slate."
56
- task :cleantest => [:clean, :test]
57
50
  end
58
51
  end
59
52
  end
@@ -145,8 +145,9 @@ module Yolo
145
145
  super
146
146
  namespace :yolo do
147
147
  namespace :release do
148
- desc "Builds and packages a release ipa of specified scheme."
149
- task :ipa => :build do
148
+ desc "Builds and deploys a release ipa of specified scheme."
149
+ task :ipa do
150
+ xcodebuild :build
150
151
  Yolo::Tools::Ios::IPA.generate(app_path,dsym_path,bundle_path) do |ipa|
151
152
  deploy(ipa) if ipa and self.deployment
152
153
  end
@@ -172,11 +173,6 @@ module Yolo
172
173
  task :notes do
173
174
  Yolo::Tools::Ios::ReleaseNotes.generate(info_plist_path)
174
175
  end
175
-
176
- desc "Builds the specified release scheme."
177
- task :build do
178
- xcodebuild :build
179
- end
180
176
  end
181
177
  end
182
178
  end
@@ -64,7 +64,7 @@ module Yolo
64
64
 
65
65
  #
66
66
  # Moves the projects releas notes file to a location
67
- # @param output_directory [type] [description]
67
+ # @param directory [String] The directory to move the release notes to
68
68
  #
69
69
  # @return [type] [description]
70
70
  def self.move_release_notes(directory)
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe Yolo::Config::Install do
4
+ describe "when installing" do
5
+ before do
6
+ Yolo::Formatters::ProgressFormatter.any_instance.stub(:puts)
7
+ FileUtils.stub(:cp_r)
8
+ FileUtils.stub(:mv)
9
+ File.stub(:dirname){"current"}
10
+ Dir.stub(:pwd){"current"}
11
+ @default_rakefile = "current/yolo-Rakefile"
12
+ end
13
+
14
+ it "should copy the default rakefile into place" do
15
+ Yolo::Config::Install.stub(:`)
16
+ FileUtils.should_receive(:cp_r).with(@default_rakefile, "current")
17
+ Yolo::Config::Install.run
18
+ end
19
+
20
+ it "should remove the yolo prefix from the default rake file" do
21
+ FileUtils.should_receive(:mv).with("current/yolo-Rakefile","current/Rakefile")
22
+ Yolo::Config::Install.rename_rakefile
23
+ end
24
+ end
25
+ end
@@ -1,6 +1,4 @@
1
1
  require 'spec_helper'
2
- require "yolo/config/settings"
3
- require 'yolo/formatters'
4
2
 
5
3
  describe Yolo::Config::Settings do
6
4
 
@@ -1,7 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'yolo/deployment'
3
- require 'yolo/formatters'
4
- require 'yolo/config'
5
2
 
6
3
  describe Yolo::Deployment::BaseDeployer do
7
4
 
@@ -1,8 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'yolo/deployment'
3
- require 'yolo/formatters'
4
- require 'yolo/config'
5
- require 'json'
6
2
 
7
3
  describe Yolo::Deployment::OTA do
8
4
 
@@ -1,8 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'yolo/deployment'
3
- require 'yolo/formatters'
4
- require "yolo/tools/ios/release_notes"
5
- require 'yolo/config'
6
2
 
7
3
  describe Yolo::Deployment::TestFlight do
8
4
 
@@ -1,7 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'yolo/notify/email'
3
- require 'yolo/formatters'
4
- require 'yolo/config'
5
2
 
6
3
  describe Yolo::Notify::Email do
7
4
 
@@ -1,9 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'yolo/notify/email'
3
- require 'yolo/notify/ios'
4
- require 'yolo/formatters'
5
- require 'yolo/config'
6
- require 'yolo/tools'
7
2
 
8
3
  describe Yolo::Notify::Ios::OTAEmail do
9
4
 
@@ -1,4 +1,7 @@
1
1
  require 'coveralls'
2
+ require 'yolo'
3
+ require 'active_support/all'
4
+
2
5
  Coveralls.wear!
3
6
 
4
7
  RSpec.configure do |config|
@@ -11,3 +14,4 @@ RSpec.configure do |config|
11
14
  # Use the specified formatter
12
15
  config.formatter = :documentation # :progress, :html, :textmate
13
16
  end
17
+
@@ -1,4 +1,4 @@
1
- require 'yolo/tasks'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Yolo::Tasks::BaseTask do
4
4
 
@@ -1,4 +1,4 @@
1
- require 'yolo/tasks'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Yolo::Tasks::Ios::Build do
4
4
  describe "when building an options string" do
@@ -1,4 +1,4 @@
1
- require 'yolo/tasks'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Yolo::Tasks::Ios::Calabash do
4
4
  before do
@@ -1,6 +1,4 @@
1
- require 'yolo/tasks'
2
- require 'yolo/tools'
3
- require 'active_support/all'
1
+ require 'spec_helper'
4
2
 
5
3
  describe Yolo::Tasks::Ios::Coverage do
6
4
  before do
@@ -1,4 +1,4 @@
1
- require 'yolo/tasks'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Yolo::Tasks::Ios::OCUnit do
4
4
  before do
@@ -1,10 +1,4 @@
1
- require 'yolo/tasks'
2
- require 'yolo/tools'
3
- require 'yolo/notify'
4
- require "yolo/formatters"
5
- require "yolo/config"
6
- require "yolo/deployment"
7
- require 'active_support/all'
1
+ require 'spec_helper'
8
2
 
9
3
  describe Yolo::Tasks::Ios::Release do
10
4
  before do
@@ -1,6 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'yolo/tools/git'
3
- require 'yolo/formatters'
4
2
 
5
3
  describe Yolo::Tools::Git do
6
4
 
@@ -1,5 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'yolo/tools/ios/calabash'
3
2
 
4
3
  describe Yolo::Tools::Ios::Calabash do
5
4
 
@@ -1,6 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'yolo/tools/ios/coverage'
3
- require 'yolo/formatters'
4
2
 
5
3
  describe Yolo::Tools::Ios::Coverage do
6
4
 
@@ -1,6 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'yolo/tools/ios/ipa'
3
- require 'yolo/formatters'
4
2
 
5
3
  describe Yolo::Tools::Ios::IPA do
6
4
 
@@ -1,7 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'yolo/tools/ios/xcode'
3
- require 'yolo/tools/ios/release_notes'
4
- require 'yolo/formatters'
5
2
 
6
3
  describe Yolo::Tools::Ios::ReleaseNotes do
7
4
 
@@ -1,6 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'yolo/tools/ios/xcode'
3
- require 'yolo/formatters'
4
2
 
5
3
  describe Yolo::Tools::Ios::Xcode do
6
4
  before do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yolo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.18
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-09 00:00:00.000000000 Z
12
+ date: 2013-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: xcodebuild-rb
@@ -78,13 +78,16 @@ dependencies:
78
78
  description: yolo is a RubyGem which provides a Ruby interface to Continuous Integration
79
79
  build tools. yolo is currently geared towards the Xcode toolchain and iOS development.
80
80
  email: alex@alexefish.com
81
- executables: []
81
+ executables:
82
+ - yolo
82
83
  extensions: []
83
84
  extra_rdoc_files: []
84
85
  files:
85
- - Rakefile
86
+ - bin/yolo
86
87
  - lib/yolo/config/config.yml
88
+ - lib/yolo/config/install.rb
87
89
  - lib/yolo/config/settings.rb
90
+ - lib/yolo/config/yolo-Rakefile
88
91
  - lib/yolo/config.rb
89
92
  - lib/yolo/deployment/base_deployer.rb
90
93
  - lib/yolo/deployment/ota.rb
@@ -116,6 +119,7 @@ files:
116
119
  - lib/yolo/tools/ios.rb
117
120
  - lib/yolo/tools.rb
118
121
  - lib/yolo.rb
122
+ - spec/config/install_spec.rb
119
123
  - spec/config/settings_spec.rb
120
124
  - spec/deployment/base_deployer_spec.rb
121
125
  - spec/deployment/ota_spec.rb
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- require 'yolo'
3
-
4
- namespace :gem do
5
- desc "Builds and then installs the gem"
6
- task :buildinstall do
7
- system 'gem build yolo.gemspec'
8
- system 'gem install yolo-1.1.12.pre.gem'
9
- end
10
- end