earlgrey 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1972a16b889694e40144daae83363078039e809
4
- data.tar.gz: e641d0ccbb11ecb6558117e6c13e502e64945539
3
+ metadata.gz: 65c301807050c57123110ae6f49ca194084836b1
4
+ data.tar.gz: c2971e809b71d8966b05d0d9af0e147b74d9cff7
5
5
  SHA512:
6
- metadata.gz: bed9d5275e683cea83fd0ff49474721d7cf21200d28ecf6e14e0c7c1f1777575f9e648e894f43828e39192c27d3aee3c161030123c1e31ed36a4375872dbe5eb
7
- data.tar.gz: ca00c4c5a89afb57064b59f46bf1a9510c852f37cc8c327c024d2d654425a7abb9a510fb7507b331813c990c26939bb47c0c2ff93166ea1304d6c3142f56f516
6
+ metadata.gz: 3e0ec4554e0216c1d3b1f2c023dadd684f38ae00b2526502b00102d1730575748f60f0bd3e3db27abc3e4b770056ad5d554aaf63a1c07b19e45daee641dc1f81
7
+ data.tar.gz: 6e34a68b52fac4afaeba8068e6691d500a34ed33b43e1f4647263b6d7c1874553ff46b97f6b7bd0275e8ed09e4aab5337800c86ef2b9477ffe4545712e8c354e
@@ -20,21 +20,27 @@ end
20
20
 
21
21
  module EarlGrey
22
22
  class << self
23
- attr_reader :project_name, :test_target, :test_target_name, :scheme_file,
23
+ attr_reader :project_name, :installer, :test_target, :test_target_name, :scheme_file,
24
24
  :user_project, :carthage, :swift, :swift_version
25
25
 
26
26
  # Returns path to Xcode file, prepending current working dir if necessary.
27
- # @param xcode_file [String] xcode file path
27
+ # @param project_name [String] name of the .xcodeproj file
28
28
  # @param ext [String] xcode file extension
29
29
  # @return [String] path to Xcode file
30
- def path_for(xcode_file, ext)
31
- ext_match = File.extname(xcode_file) == ext
32
- return xcode_file if File.exist?(xcode_file) && ext_match
33
-
34
- path = File.join(Dir.pwd, File.basename(xcode_file, '.*') + ext)
30
+ def path_for(project_name, ext)
31
+ ext_match = File.extname(project_name) == ext
32
+ return project_name if File.exist?(project_name) && ext_match
33
+ path = File.join(dir_path, File.basename(project_name, '.*') + ext)
35
34
  path ? path : nil
36
35
  end
37
36
 
37
+ # Returns the project's directory. If CocoaPods hasn't had it passed in, then the current
38
+ # directory is chosen.
39
+ # @return [String] directory path for the Xcode project
40
+ def dir_path
41
+ installer ? installer.config.installation_root : Dir.pwd
42
+ end
43
+
38
44
  # Strips each line in a string
39
45
  # @param string [String] the string to process
40
46
  # @return [String] the modified string
@@ -67,6 +73,7 @@ module EarlGrey
67
73
  @swift = opts.fetch(:swift, false)
68
74
  @carthage = opts.fetch(:carthage, false)
69
75
  @swift_version = opts.fetch(:swift_version, '3.0')
76
+ @installer = installer
70
77
 
71
78
  puts_blue "Checking and Updating #{project_name} for EarlGrey."
72
79
  pods_project = installer ? installer.pods_project : true
@@ -349,7 +356,7 @@ module EarlGrey
349
356
  user_project.save
350
357
 
351
358
  src_root = File.join(__dir__, 'files')
352
- dst_root = File.join(Dir.pwd, test_target_name)
359
+ dst_root = File.join(dir_path, test_target_name)
353
360
  raise "Missing target folder #{dst_root}" unless File.exist? dst_root
354
361
 
355
362
  src_header_name = 'BridgingHeader.h'
@@ -14,5 +14,5 @@
14
14
  # limitations under the License.
15
15
 
16
16
  module EarlGrey
17
- VERSION = '0.0.13'.freeze unless defined? ::EarlGrey::VERSION
17
+ VERSION = '0.0.14'.freeze unless defined? ::EarlGrey::VERSION
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: earlgrey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - khandpur
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-09-20 00:00:00.000000000 Z
13
+ date: 2016-10-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: colored