lib/xcake/project/sugar.rb in xcake-0.6.19 vs lib/xcake/project/sugar.rb in xcake-0.6.20
- old
+ new
@@ -1,19 +1,18 @@
-require "xcodeproj"
+require 'xcodeproj'
module Xcake
class Project
-
# Passes the project instance to a block. This is used to easily modify the
# properties of the project in the DSL.
#
#
# @param [Proc] block
# an optional block that configures the project through the DSL.
#
- def project(&block)
- block.call(self) if block_given?
+ def project
+ yield(self) if block_given?
self
end
# Defines a new application target.
#
@@ -30,18 +29,18 @@
# an optional block that configures the target through the DSL.
#
# @return [Target] the application target
# the newly created application target
#
- def application_for(platform, deployment_target, language = :objc, &block)
+ def application_for(platform, deployment_target, language = :objc)
target do |t|
t.type = :application
t.platform = platform
t.deployment_target = deployment_target
t.language = language
- block.call(t) if block_given?
+ yield(t) if block_given?
end
end
# Defines a new unit test target.
#
@@ -52,28 +51,28 @@
# an optional block that configures the target through the DSL.
#
# @return [Target] the unit test target
# the newly created unit test target
#
- def unit_tests_for(host_target, &block)
+ def unit_tests_for(host_target)
target do |t|
t.name = "#{host_target.name}Tests"
t.type = :unit_test_bundle
t.platform = host_target.platform
t.deployment_target = host_target.deployment_target
t.language = host_target.language
host_path = "#{host_target.name}.app/#{host_target.name}"
t.all_configurations.each do |c|
- c.settings["TEST_HOST"] = "$(BUILT_PRODUCTS_DIR)/#{host_path}"
+ c.settings['TEST_HOST'] = "$(BUILT_PRODUCTS_DIR)/#{host_path}"
end
t.all_configurations.each do |c|
- c.settings["BUNDLE_LOADER"] = "$(TEST_HOST)"
+ c.settings['BUNDLE_LOADER'] = '$(TEST_HOST)'
end
- block.call(t) if block_given?
+ yield(t) if block_given?
end
end
# Defines targets for watch app.
#
@@ -83,11 +82,11 @@
# @param [Proc] block
# an optional block that configures the targets through the DSL.
#
# @return Void
#
- def watch_app_for(host_target, deployment_target, language = :objc, &block)
+ def watch_app_for(host_target, deployment_target, language = :objc)
watch_app_target = target do |t|
t.name = "#{host_target.name}-Watch"
t.type = :watch2_app
t.platform = :watchos
@@ -105,11 +104,11 @@
end
host_target.target_dependencies << watch_app_target
watch_app_target.target_dependencies << watch_extension_target
- block.call(watch_app_target, watch_extension_target) if block_given?
+ yield(watch_app_target, watch_extension_target) if block_given?
- return nil
+ nil
end
end
end