mayday 0.0.1 → 0.1.0

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: c78e754b1dc60b302813defb808feecea2b0d056
4
- data.tar.gz: f2e8d5ef9935f9d5a132e04b2be0e2219aad00a5
3
+ metadata.gz: bead9398a12d7fac991556b67b4af793675ef6a0
4
+ data.tar.gz: 7627a3a3648e2c8655a70df4d3e0856f05b3a6fc
5
5
  SHA512:
6
- metadata.gz: 8ff4fe103f6da0e9ca701f807b81c9f7d9f38c360e511db50c5f604b75012ecd88bd2cd9923212bdb3bb5fbfd99ed551a0264852e0ff9e75921ce4e01b4a6ab4
7
- data.tar.gz: 9439827e1a41aa7dd6aca66c268d88c06c80fe5327a87de0b59373d6066df108c8919f2c67a2e1e4a10e58b182a1bf2518d1b35c2825531cb86f9f9ab2ca23bf
6
+ metadata.gz: 473733c6f78fa151001c7517f6fe271a3f142978ec8239802b645653461794dbeab2e5a4ab77d34b29d869c75fab30f1ca630aad6d69b21e3ebd3d1bb4267951
7
+ data.tar.gz: 424758711041f7e6ed420077a2f941eb6f2106e775d4af2f9ef98cc906759184dde684c03520e82e2a91830dc7006b0896610a50bea4ed2a737d495ece8af776
data/.travis.yml ADDED
@@ -0,0 +1,19 @@
1
+ language: objective-c
2
+ script: bundle exec rspec
3
+
4
+ # Sets Travis to run the Ruby specs on OS X machines which are required to
5
+ # build the native extensions of Xcodeproj.
6
+
7
+ env:
8
+ - RVM_RUBY_VERSION=system
9
+
10
+ before_install:
11
+ - curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/share/cacert.pem
12
+ - source ~/.rvm/scripts/rvm
13
+ - if [[ $RVM_RUBY_VERSION != 'system' ]]; then rvm install $RVM_RUBY_VERSION; fi
14
+ - rvm use $RVM_RUBY_VERSION
15
+ - if [[ $RVM_RUBY_VERSION == 'system' ]]; then export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future; fi
16
+ - if [[ $RVM_RUBY_VERSION == 'system' ]]; then sudo gem install bundler --no-ri --no-rdoc; else gem install bundler --no-ri --no-rdoc; fi
17
+
18
+ install:
19
+ - bundle install --without=documentation --path ./travis_bundle_dir
data/README.md CHANGED
@@ -1,29 +1,41 @@
1
- Easily add custom warnings and errors to your Xcode project's build process.
1
+ [![Gem Version](https://badge.fury.io/rb/mayday.svg)](http://badge.fury.io/rb/mayday)
2
+ [![Build Status](https://travis-ci.org/marklarr/mayday.svg?branch=master)](https://travis-ci.org/marklarr/mayday)
2
3
 
3
- ## Installation
4
4
 
5
- $ gem install mayday
5
+ Easily add custom warnings and errors to your Xcode project's build process
6
+
7
+ ## Installation
8
+ ```sh
9
+ $ gem install mayday
10
+ ```
6
11
 
7
12
  ## Usage
8
13
 
9
- Create a Maydayfile at the root of your project, defining your warnings and errors using `warning`, `error`, `warning_regex`, and `error_regex`.
14
+ Create a Maydayfile
15
+
16
+ ```sh
17
+ $ mayday init
18
+ ```
19
+
20
+ Add some warning and error checks to that file
10
21
 
11
22
  ```ruby
12
23
  # Maydayfile
13
24
 
14
25
  # Required
15
26
  xcode_proj "CoolApp.xcodeproj"
16
- # Required. This will most likely be the same name as your project.
17
- main_target "CoolApp"
18
27
 
19
28
  # Use regular expressions to define errors or warnings on a line-by-line basis
29
+ error_regex "Please remove Copyright boilerplate", /^\/\/ Copyright \(c\).*$/, :files => "*AppDelegate*"
30
+ warning_regex "TODO", /^\/\/\s+TODO:.*$/
31
+ ```
20
32
 
21
- error_regex "Please remove Copyright boilerplate", /^\/\/ Copyright \(c\).*$/, :files => "*AppDelegate*", :exclude => "Fixtures/SomeDir/Excluded/*"
33
+ You can do more advanced checks, too, with blocks
22
34
 
23
- warning_regex "TODO", /^\/\/\s+TODO:.*$/
35
+ ``` ruby
36
+ # Maydayfile
24
37
 
25
- # Do more complicated checks or return dynamic messages via blocks
26
- warning :line do |line|
38
+ warning :line, :exclude => "Fixtures/SomeDir/Excluded/*" do |line|
27
39
  line.length > 120 ? "Length of line #{line.length} is longer than 120 characters!" : false
28
40
  end
29
41
 
@@ -39,12 +51,21 @@ error :file do |entire_file|
39
51
  false
40
52
  end
41
53
  end
42
-
43
54
  ```
44
55
 
45
- And then,
56
+ When you're ready, run
57
+
58
+ ```sh
59
+ $ mayday
60
+ ```
61
+
62
+ Next time you build your project, your errors and warnings will be flagged
46
63
 
47
- $ mayday
64
+ ![Mayday warnings and errors in Xcode](https://raw.githubusercontent.com/marklarr/mayday/master/docs/example.jpg?token=760261__eyJzY29wZSI6IlJhd0Jsb2I6bWFya2xhcnIvbWF5ZGF5L21hc3Rlci9kb2NzL2V4YW1wbGUuanBnIiwiZXhwaXJlcyI6MTQxNDM5MDIxNH0%3D--e7969b95aea1bc76749ae9226d2ac5ffef0cf322)
65
+
66
+ ![Mayday warnings and errors in Xcode, inline](https://raw.githubusercontent.com/marklarr/mayday/master/docs/example_inline.jpg?token=760261__eyJzY29wZSI6IlJhd0Jsb2I6bWFya2xhcnIvbWF5ZGF5L21hc3Rlci9kb2NzL2V4YW1wbGVfaW5saW5lLmpwZyIsImV4cGlyZXMiOjE0MTQzOTAzMzh9--bc9abbe40843317e7b6a30a9521ebf6ae457ece2)
67
+
68
+ Since Ruby is installed by default on OSX, the warnings and errors will work for anybody building your project, even if they don't have RVM, RubyGems, or mayday.
48
69
 
49
70
  ### Options
50
71
 
@@ -61,20 +82,27 @@ And then,
61
82
 
62
83
  You may be concerned about how much overhead this will add to your build process. To see how quickly your `mayday` checks execute, use
63
84
 
64
- $ mayday benchmark
85
+ ```sh
86
+ $ mayday benchmark
87
+ ```
65
88
 
66
89
  ## Caveats
67
90
 
68
- * Since `mayday` uses [sourcify]() to write your custom `warning` and `errors` blocks to a build phase, all [gotchas in sourcify](https://github.com/ngty/sourcify#gotchas) apply to your blocks.
69
- * Generating efficient code to write into the build phase is difficult. `MayDay::ScriptGenerator#to_ruby` could definitely by optimized.
91
+ * `mayday` uses [sourcify]() to write your custom `warning` and `errors` blocks to a build phase, all [gotchas in sourcify](https://github.com/ngty/sourcify#gotchas) apply to your blocks.
92
+ * `mayday` copies your custom blocks, line for line, into a build phase, so all variables inside of them must be of local scope. Anything defined outside of a custom block will not be included in the build phase.
93
+ * Gems cannot but used inside of custom blocks, only vanilla, system Ruby.
94
+ * If your custom blocks have errors in them that aren't found until they're executed (which is done whenever you call `mayday`), the stack trace won't be very helpful in debugging (because there is no source map from the build phase back to your `Maydayfile` code)
95
+ * Generating efficient code to write into the build phase is difficult. The code generated by `MayDay::ScriptGenerator#to_ruby` could definitely be optimized.
70
96
 
71
97
 
72
98
  ## Uninstallation
73
99
 
74
- $ mayday down
100
+ ```sh
101
+ $ mayday down
102
+ ```
75
103
 
76
104
  ## Contributing
77
105
 
78
- We'd love to see your ideas for improving this library! The best way to contribute is by submitting a pull request. We'll do our best to respond to your patch as soon as possible. You can also submit a [new Github issue](https://github.com/venmo/synx/issues/new) if you find bugs or have questions. :octocat:
106
+ We'd love to see your ideas for improving this library! The best way to contribute is by submitting a pull request. We'll do our best to respond to your patch as soon as possible. You can also submit a [new GitHub issue](https://github.com/marklarr/mayday/issues/new) if you find bugs or have questions. :octocat:
79
107
 
80
108
  Please make sure to follow our general coding style and add test coverage for new features!
data/bin/mayday CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'clamp'
4
4
  require 'mayday'
5
+ require 'colorize'
5
6
 
6
7
  Clamp do
7
8
 
@@ -9,11 +10,19 @@ Clamp do
9
10
 
10
11
  MAYDAY_FILE_PATH = "Maydayfile"
11
12
 
13
+ subcommand "init", "Creates a new Maydayfile" do
14
+ def execute
15
+ puts "Creating a new Maydayfile..."
16
+ Mayday::UserDefinitions.new(MAYDAY_FILE_PATH).init
17
+ puts "Done!".green
18
+ end
19
+ end
20
+
12
21
  subcommand "up", "Integrate the warnings and errors from Maydayfile into your Xcode project" do
13
22
  def execute
14
23
  puts "Integrating mayday into your project..."
15
24
  Mayday::UserDefinitions.new(MAYDAY_FILE_PATH).up
16
- puts "Done!"
25
+ puts "Done!".green
17
26
  end
18
27
  end
19
28
 
@@ -21,7 +30,7 @@ Clamp do
21
30
  def execute
22
31
  puts "Removing mayday from your project..."
23
32
  Mayday::UserDefinitions.new(MAYDAY_FILE_PATH).down
24
- puts "Done!"
33
+ puts "Done!".green
25
34
  end
26
35
  end
27
36
 
data/docs/example.jpg ADDED
Binary file
Binary file
data/lib/mayday/reader.rb CHANGED
@@ -16,12 +16,7 @@ module Mayday
16
16
  def to_target_integrator
17
17
  instance_eval(@mayday_file.read, @mayday_file.path, 0)
18
18
  validate_xcode_proj
19
- validate_main_target_name
20
- TargetIntegrator.new(@xcode_proj, @script_generator, @main_target_name)
21
- end
22
-
23
- def main_target(main_target_name)
24
- @main_target_name = main_target_name
19
+ TargetIntegrator.new(@xcode_proj, @script_generator)
25
20
  end
26
21
 
27
22
  def xcode_proj(xcode_proj_path)
@@ -45,14 +40,6 @@ module Mayday
45
40
  end
46
41
  private :validate_xcode_proj
47
42
 
48
- def validate_main_target_name
49
- unless @main_target_name
50
- puts "No main target specified in #{@mayday_file.path}. Specify one using main_target_name 'My Target'".red
51
- abort
52
- end
53
- end
54
- private :validate_xcode_proj
55
-
56
43
  def abstract_flag_regex(klass, message, regex, options={})
57
44
  block = <<-CODE
58
45
  lambda do |line|
@@ -80,7 +67,7 @@ end
80
67
  when Proc
81
68
  block.to_source
82
69
  else
83
- raise TypeError, "#{self.class}'s block has invalid type of #{@block.class}"
70
+ raise TypeError, "#{klass}'s block has invalid type of #{@block.class}"
84
71
  end
85
72
 
86
73
  final_block = case type
@@ -3,25 +3,28 @@ require 'xcodeproj'
3
3
  module Mayday
4
4
  class TargetIntegrator
5
5
 
6
- def initialize(project, script_generator, target_name)
6
+ def initialize(project, script_generator)
7
7
  @project = project
8
8
  @script_generator = script_generator
9
- @target_name = target_name
10
9
  end
11
10
 
12
11
  def integrate
13
12
  if runs_successfully?
14
- phase = existing_mayday_build_phase_for_native_target(native_target_to_integrate) || native_target_to_integrate.new_shell_script_build_phase(mayday_build_phase_name)
15
- phase.shell_path = "/usr/bin/ruby"
16
- phase.shell_script = @script_generator.to_ruby
17
- phase.show_env_vars_in_log = '0'
13
+ native_targets_to_integrate.each do |native_target_to_integrate|
14
+ phase = existing_mayday_build_phase_for_native_target(native_target_to_integrate) || native_target_to_integrate.new_shell_script_build_phase(mayday_build_phase_name)
15
+ phase.shell_path = "/usr/bin/ruby"
16
+ phase.shell_script = @script_generator.to_ruby
17
+ phase.show_env_vars_in_log = '0'
18
+ end
18
19
  @project.save
19
20
  end
20
21
  end
21
22
 
22
23
  def deintegrate
23
- phase = existing_mayday_build_phase_for_native_target(native_target_to_integrate)
24
- phase.remove_from_project if phase
24
+ native_targets_to_integrate.each do |native_target_to_integrate|
25
+ phase = existing_mayday_build_phase_for_native_target(native_target_to_integrate)
26
+ phase.remove_from_project if phase
27
+ end
25
28
  @project.save
26
29
  end
27
30
 
@@ -40,20 +43,19 @@ module Mayday
40
43
  end
41
44
  end
42
45
 
43
- def native_target_to_integrate
44
- native_target = @project.targets.detect do |target|
45
- target.is_a?(Xcodeproj::Project::Object::PBXNativeTarget) && target.name == @target_name
46
+ def native_targets_to_integrate
47
+ native_targets = @project.targets.select do |target|
48
+ target.is_a?(Xcodeproj::Project::Object::PBXNativeTarget)
46
49
  end
47
50
 
48
- if native_target
49
- native_target
51
+ if native_targets.count > 0
52
+ native_targets
50
53
  else
51
- valid_target_names = @project.targets.select { |target| target.is_a?(Xcodeproj::Project::Object::PBXNativeTarget) }.map(&:name)
52
- puts "Could not find a target named #{@target_name} in #{@project.path}. Available targets: #{valid_target_names.join(", ")}".red
54
+ puts "Could not find any native targets that have no target dependencies".red
53
55
  abort
54
56
  end
55
57
  end
56
- private :native_target_to_integrate
58
+ private :native_targets_to_integrate
57
59
 
58
60
  def existing_mayday_build_phase_for_native_target(native_target)
59
61
  native_target.shell_script_build_phases.detect { |bp| bp.name == mayday_build_phase_name }
@@ -8,6 +8,22 @@ module Mayday
8
8
  @mayday_file_path = mayday_file_path
9
9
  end
10
10
 
11
+ def init
12
+ if File.exist?(@mayday_file_path)
13
+ puts "#{@mayday_file_path} already exists".red
14
+ abort
15
+ else
16
+ File.open(@mayday_file_path, 'w') do |file|
17
+ file.write <<-CODE
18
+ xcode_proj '#{nearby_xcodeproj}'
19
+
20
+ warning_regex 'TODO:', /\\s+\\/\\/\\s?TODO:/
21
+ CODE
22
+ puts "#{@mayday_file_path} created".green
23
+ end
24
+ end
25
+ end
26
+
11
27
  def up
12
28
  mayday_file do |file|
13
29
  Reader.new(file).to_target_integrator.integrate
@@ -28,7 +44,7 @@ module Mayday
28
44
 
29
45
  def mayday_file
30
46
  unless File.exist?(@mayday_file_path)
31
- puts "No file found at path ./#{@mayday_file_path}".red
47
+ puts "No #{@mayday_file_path} found".red
32
48
  abort
33
49
  end
34
50
 
@@ -38,5 +54,12 @@ module Mayday
38
54
  end
39
55
  private :mayday_file
40
56
 
57
+ def nearby_xcodeproj
58
+ nearby = Dir["**/*.xcodeproj"].reject { |xcodeproj_path| xcodeproj_path =~ /Pods\//}.first
59
+ puts "Xcodeproj couldn't be found".yellow unless nearby
60
+ nearby
61
+ end
62
+ private :nearby_xcodeproj
63
+
41
64
  end
42
65
  end
@@ -1,3 +1,3 @@
1
1
  module Mayday
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -13,7 +13,7 @@ class FixturesTests: XCTestCase {
13
13
 
14
14
  override func setUp() {
15
15
  super.setUp()
16
- // Put setup code here. This method is called before the invocation of each test method in the class.
16
+ // Put setup code here. This method is called before the invocation of each test method in the class. // Put setup code here. This method is called before the invocation of each test method in the class.
17
17
  }
18
18
 
19
19
  override func tearDown() {
@@ -1,5 +1,4 @@
1
1
  xcode_proj "Fixtures/Fixtures.xcodeproj"
2
- main_target "Fixtures"
3
2
 
4
3
  warning :line, :language => "swift" do |line|
5
4
  line.length > 120 ? "Length of line #{line.length} is longer than 120 characters!" : false
@@ -1,5 +1,4 @@
1
1
  xcode_proj "Fixtures/Fixtures.xcodeproj"
2
- main_target "Fixtures"
3
2
 
4
3
  warning :line, :language => "swift" do |line|
5
4
  raise "error"
@@ -2,14 +2,16 @@ require 'spec_helper'
2
2
 
3
3
  describe Mayday::UserDefinitions do
4
4
 
5
- def parse_build_output
6
- output =`xcodebuild -project spec/test_fixtures/Fixtures/Fixtures.xcodeproj/ -scheme Fixtures -configuration Debug`
5
+ def parse_build_output(opts={})
6
+ extra_test_flags = opts[:test] ? "-sdk iphonesimulator test" : ""
7
+ output =`xcodebuild -project spec/test_fixtures/Fixtures/Fixtures.xcodeproj/ -scheme Fixtures -configuration Debug #{extra_test_flags}`
7
8
  exitstatus = $?.exitstatus
8
9
  files_to_lines_to_warnings_hash = {}
9
10
  output.split("\n").each do |line|
10
11
  matches = line.match(/((.+):([0-9]+):\s(.+))/)
11
12
  if matches
12
- file_path = matches[2]
13
+ # Get path relative to spec/test_fixtures
14
+ file_path = matches[2].split("/spec/").last
13
15
  line_number = matches[3]
14
16
  flag_message = matches[4]
15
17
 
@@ -42,36 +44,40 @@ describe Mayday::UserDefinitions do
42
44
  let(:files_to_lines_to_warnings_hash) { @parsed_build_output[:files_to_lines_to_warnings_hash] }
43
45
 
44
46
  describe "#up" do
45
- describe "after running xcodebuild" do
46
- before(:all) do
47
- user_definitions = Mayday::UserDefinitions.new(FIXTURES_TEST_MAYDAY_FILE_PATH)
48
- user_definitions.up
49
- @parsed_build_output = parse_build_output
50
- end
47
+ before(:all) do
48
+ user_definitions = Mayday::UserDefinitions.new(FIXTURES_TEST_MAYDAY_FILE_PATH)
49
+ user_definitions.up
50
+ end
51
51
 
52
- it "should have failed the build" do
53
- expect(@parsed_build_output[:exitstatus]).to_not eq(0)
54
- end
52
+ [{}, {:test => true}].each do |options|
55
53
 
56
- it "should have output all files with warnings or errors in them" do
57
- expect(files_to_lines_to_warnings_hash.count).to eq(3)
58
- end
54
+ describe "after running xcodebuild on the main target with #{options}" do
55
+ before(:all) { @parsed_build_output = parse_build_output(options) }
56
+
57
+ it "should have failed the build" do
58
+ expect(@parsed_build_output[:exitstatus]).to_not eq(0)
59
+ end
59
60
 
60
- it "should have, for every file, output all of the warnings or errors in them" do
61
- some_object_h_flags = files_to_lines_to_warnings_hash['/Users/marklarsen/github.com/mayday/spec/test_fixtures/Fixtures/Fixtures/SomeDir/SomeObject.h']
62
- app_delegate_swift_flags = files_to_lines_to_warnings_hash['/Users/marklarsen/github.com/mayday/spec/test_fixtures/Fixtures/Fixtures/AppDelegate.swift']
63
- long_file_m_flags = files_to_lines_to_warnings_hash['/Users/marklarsen/github.com/mayday/spec/test_fixtures/Fixtures/Fixtures/SomeDir/LongFile.m']
61
+ it "should have output all files with warnings or errors in them" do
62
+ expect(files_to_lines_to_warnings_hash.count).to eq(4)
63
+ end
64
64
 
65
- expect(some_object_h_flags.count).to eq(1)
66
- expect(app_delegate_swift_flags.count).to eq(9)
67
- expect(long_file_m_flags.count).to eq(1)
65
+ it "should have, for every file, output all of the warnings or errors in them" do
66
+ some_object_h_flags = files_to_lines_to_warnings_hash['test_fixtures/Fixtures/Fixtures/SomeDir/SomeObject.h']
67
+ app_delegate_swift_flags = files_to_lines_to_warnings_hash['test_fixtures/Fixtures/Fixtures/AppDelegate.swift']
68
+ long_file_m_flags = files_to_lines_to_warnings_hash['test_fixtures/Fixtures/Fixtures/SomeDir/LongFile.m']
69
+
70
+ expect(some_object_h_flags.count).to eq(1)
71
+ expect(app_delegate_swift_flags.count).to eq(9)
72
+ expect(long_file_m_flags.count).to eq(1)
73
+ end
68
74
  end
69
- end
70
75
 
71
- describe "when using a Maydayfile containing Ruby errors" do
72
- it "should raise the exception to the user when they try to 'up'" do
73
- user_definitions = Mayday::UserDefinitions.new(FIXTURES_TEST_MAYDAY_FILE_RUBY_ERROR_PATH)
74
- expect { user_definitions.up }.to raise_error("error")
76
+ describe "when using a Maydayfile containing Ruby errors" do
77
+ it "should raise the exception to the user when they try to 'up'" do
78
+ user_definitions = Mayday::UserDefinitions.new(FIXTURES_TEST_MAYDAY_FILE_RUBY_ERROR_PATH)
79
+ expect { user_definitions.up }.to raise_error("error")
80
+ end
75
81
  end
76
82
  end
77
83
  end
@@ -95,6 +101,37 @@ describe Mayday::UserDefinitions do
95
101
  end
96
102
  end
97
103
 
104
+ describe "#init" do
105
+ describe "Maydayfile doesn't exist" do
106
+ before(:all) do
107
+ @mayday_file_doesnt_exist_path = "Maydayfile_doesnt_exist"
108
+ FileUtils.rm_rf(@mayday_file_doesnt_exist_path)
109
+ user_definitions = Mayday::UserDefinitions.new(@mayday_file_doesnt_exist_path)
110
+ user_definitions.init
111
+ end
112
+
113
+ after(:all) do
114
+ FileUtils.rm_rf(@mayday_file_doesnt_exist_path)
115
+ end
116
+
117
+ it "should create a valid Maydayfile prefilled with the nearest xcodeproject" do
118
+ user_definitions = Mayday::UserDefinitions.new(@mayday_file_doesnt_exist_path)
119
+ user_definitions.up
120
+ user_definitions.down
121
+ end
122
+ end
123
+
124
+ describe "Maydayfile already exists" do
125
+ it "should keep the Maydayfile as-is and abort" do
126
+ before_file_contents = File.open(FIXTURES_TEST_MAYDAY_FILE_PATH) { |file| file.read }
127
+ user_definitions = Mayday::UserDefinitions.new(FIXTURES_TEST_MAYDAY_FILE_PATH)
128
+ lambda { user_definitions.init }.should raise_error SystemExit
129
+ after_file_contents = File.open(FIXTURES_TEST_MAYDAY_FILE_PATH) { |file| file.read }
130
+ expect(before_file_contents).to eq(after_file_contents)
131
+ end
132
+ end
133
+ end
134
+
98
135
  describe "#benchmark" do
99
136
  it "should show benchmark data for the mayday build phase" do
100
137
  user_definitions = Mayday::UserDefinitions.new(FIXTURES_TEST_MAYDAY_FILE_PATH)
@@ -127,19 +164,6 @@ describe Mayday::UserDefinitions do
127
164
  describe "when the Maydayfile has no xcode_proj defined" do
128
165
  it "should abort" do
129
166
  mayday_file = create_mayday_file do
130
- main_target "hey"
131
- warning { |line| return nil }
132
- error { |line| return "ERROR!" }
133
- end
134
-
135
- lambda { Mayday::UserDefinitions.new(mayday_file.path).up }.should raise_error SystemExit
136
- end
137
- end
138
-
139
- describe "when the Maydayfile has no main_target_name defined" do
140
- it "should abort" do
141
- mayday_file = create_mayday_file do
142
- xcode_proj "../spec/test_fixtures/Maydayfile"
143
167
  warning { |line| return nil }
144
168
  error { |line| return "ERROR!" }
145
169
  end
@@ -152,20 +176,7 @@ describe Mayday::UserDefinitions do
152
176
  it "should abort" do
153
177
  mayday_file = create_mayday_file do
154
178
  xcode_proj "Hi.xcodeproj"
155
- main_target_name "wut"
156
- warning { |line| return nil }
157
- error { |line| return "ERROR!" }
158
- end
159
179
 
160
- lambda { Mayday::UserDefinitions.new(mayday_file.path).up }.should raise_error SystemExit
161
- end
162
- end
163
-
164
- describe "when the Maydayfile cannot find the main_target_name defined" do
165
- it "should abort" do
166
- mayday_file = create_mayday_file do
167
- xcode_proj "../spec/test_fixtures/Maydayfile"
168
- main_target_name "Nonexistent"
169
180
  warning { |line| return nil }
170
181
  error { |line| return "ERROR!" }
171
182
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mayday
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Larsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-20 00:00:00.000000000 Z
11
+ date: 2014-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -131,11 +131,14 @@ extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
133
  - ".gitignore"
134
+ - ".travis.yml"
134
135
  - Gemfile
135
136
  - LICENSE.txt
136
137
  - README.md
137
138
  - Rakefile
138
139
  - bin/mayday
140
+ - docs/example.jpg
141
+ - docs/example_inline.jpg
139
142
  - lib/mayday.rb
140
143
  - lib/mayday/abstract_flag.rb
141
144
  - lib/mayday/abstract_flag/error.rb