carthagefetch 0.1.3

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7b0380d7be2c5d0080a425e22fdaa3247cce3df3
4
+ data.tar.gz: a24c1a6ca5477c2d6ce3460f4e8752e53ef27838
5
+ SHA512:
6
+ metadata.gz: 35cb5a4cf4c08de3707aa32f4e8c80741ba9f26e4b9199f930ae2afc25037815fe3c24525bc7d50e16c9d2903e1356adabe7093522b6e689b2fe9c899078031c
7
+ data.tar.gz: 5348545bd5dade3abadd1a6750f65bb31bfcf4d23b491c48e97b59f0661efea2fd36936ee55d570054d59902f0174a2a70f3b2fa9fff16ab2807ab936d107635
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in crtrunner.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Dylan Gyesbreghs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # Carthage Fetch
2
+ ## Installation
3
+
4
+ Install it yourself as:
5
+
6
+ $ gem install carthagefetch
7
+
8
+ ## Usage
9
+
10
+ Run the following command in your project dir.
11
+
12
+ $ carthagefetch
13
+
14
+ (If you want to add a new framework, you can just run the same command)
15
+
16
+ ## License
17
+
18
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
19
+
20
+ ## Contributing
21
+
22
+ 1. Fork it ( https://github.com/icapps/carthagefetch/fork )
23
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
24
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
25
+ 4. Run `rubycop` in order to be compliant to our coding style.
26
+ 5. Push to the branch (`git push origin my-new-feature`)
27
+ 6. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/carthagefetch ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "crtrunner"
4
+
5
+ Crtrunner::run
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'carthagefetch/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.authors = ["Dylan Gyesbreghs"]
8
+ spec.email = ["dgyesbreghs@gmail.com"]
9
+ spec.description = %q{Auto import frameworks into a project}
10
+ spec.summary = %q{Auto import frameworks into a project}
11
+ spec.homepage = "https://github.com/icapps/carthagefetch/"
12
+
13
+ spec.files = `git ls-files`.split($\)
14
+ spec.executables = ["carthagefetch"]
15
+ spec.name = "carthagefetch"
16
+ spec.version = Carthagefetch::VERSION
17
+
18
+ spec.add_dependency 'colorize', '~> 0.7'
19
+ spec.add_dependency 'xcodeproj'
20
+ spec.add_dependency 'plist'
21
+ end
@@ -0,0 +1,35 @@
1
+ require "carthagefetch/version"
2
+ require "carthagefetch/carthage"
3
+ require "carthagefetch/xcode"
4
+
5
+ require "colorize"
6
+
7
+ module Carthagefetch
8
+ class << self
9
+ def run
10
+ puts '[INFO] Import started.'.colorize(:green)
11
+ if xcode?
12
+ if xcode_count == 1
13
+ puts '[VERBOSE] Detected an Xcode project.'.colorize(:green)
14
+ end
15
+ Carthage::update
16
+ Xcode::save_project xcode_project[0]
17
+ else
18
+ puts '[VERBOSE] No Xcode project Detected.'.colorize(:red)
19
+ end
20
+ end
21
+
22
+ private
23
+ def xcode?
24
+ xcode_count > 0
25
+ end
26
+
27
+ def xcode_count
28
+ return xcode_project.count
29
+ end
30
+
31
+ def xcode_project
32
+ return Dir[Dir.pwd << "/*.xcodeproj"]
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,23 @@
1
+ require 'colorize'
2
+
3
+ module Crtrunner
4
+ class Carthage
5
+ class << self
6
+ def update
7
+ puts "[VERBOSE] Update carthage.".colorize(:white)
8
+ if carthage_file?
9
+ `carthage update`
10
+ puts "[INFO] Carthage: Successfull".colorize(:green)
11
+ else
12
+ puts "[INFO] No carthage file found.".colorize(:red)
13
+ end
14
+ end
15
+
16
+ private
17
+
18
+ def carthage_file?
19
+ Dir.glob('**/Cartfile').count > 0
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,3 @@
1
+ module Carthagefetch
2
+ VERSION = "0.1.3"
3
+ end
@@ -0,0 +1,52 @@
1
+ require 'colorize'
2
+ require 'xcodeproj'
3
+ require 'plist'
4
+
5
+ module Carthagefetch
6
+ class Xcode
7
+ class << self
8
+ def save_project(project_name)
9
+ puts "[VERBOSE] Update Xcode Project.".colorize(:white)
10
+ project = open_project(project_name)
11
+ add_projects(project, frameworks, framework_buildphase(project))
12
+ puts "[INFO] Xcode: Successfull".colorize(:green)
13
+ end
14
+
15
+ private
16
+ def add_projects(project, frameworks, framework_buildphase)
17
+ addToProject = true
18
+ frameworks.each do |framework|
19
+ framework_buildphase.files.each do |file|
20
+ if file.display_name == framework
21
+ addToProject = false
22
+ end
23
+ end
24
+ if addToProject
25
+ lib_path = "Carthage/Build/iOS/" << (framework)
26
+ lib_ref = project.new_file(lib_path);
27
+ framework_buildphase.add_file_reference(lib_ref);
28
+ end
29
+ end
30
+ project.save()
31
+ end
32
+
33
+ def open_project(project_name)
34
+ return Xcodeproj::Project.open(project_name);
35
+ end
36
+
37
+ def framework_buildphase(project)
38
+ return project.objects.select{|x| x.class == Xcodeproj::Project::Object::PBXFrameworksBuildPhase}[0];
39
+ end
40
+
41
+ def frameworks
42
+ frameworks = (Dir.entries('Carthage/Build/iOS').select {|entry| File.directory? File.join('Carthage/Build/iOS',entry) and !(entry =='.' || entry == '..') })
43
+ frameworks.each do |framework|
44
+ if framework.include? ".dSYM"
45
+ frameworks.delete(framework)
46
+ end
47
+ end
48
+ return frameworks
49
+ end
50
+ end
51
+ end
52
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: carthagefetch
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.3
5
+ platform: ruby
6
+ authors:
7
+ - Dylan Gyesbreghs
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: colorize
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.7'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: xcodeproj
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: plist
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Auto import frameworks into a project
56
+ email:
57
+ - dgyesbreghs@gmail.com
58
+ executables:
59
+ - carthagefetch
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - bin/carthagefetch
69
+ - carthagefetch.gemspec
70
+ - lib/carthagefetch.rb
71
+ - lib/carthagefetch/carthage.rb
72
+ - lib/carthagefetch/version.rb
73
+ - lib/carthagefetch/xcode.rb
74
+ homepage: https://github.com/icapps/carthagefetch/
75
+ licenses: []
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.4.5.1
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Auto import frameworks into a project
97
+ test_files: []