guard-cocoapods 0.0.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0050027b72a6238aa4185d1657ad53a324493440
4
+ data.tar.gz: cd9345b45bb58d19b722222086624945d994bc4f
5
+ SHA512:
6
+ metadata.gz: 6aaea0df06a294b8c91cfc2e5f02adcb4b08a126829f13f3bfad5067ad8e60207c1e7115f75fe234f96c3a017ffbb257d0bfe4daf312124eaa6a0319b8470739
7
+ data.tar.gz: 0f13c7dc919941cf0eb1b1ecf525d389c2fb807a4ca62a6db5d3925913f43dbc97ba6e06711ac0fbffeab2055ad3b7287ed82499184015748df026a5ff0aa844
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
@@ -0,0 +1,17 @@
1
+ language: ruby
2
+ branches:
3
+ only:
4
+ - master
5
+ rvm:
6
+ - 1.9.2
7
+ - 1.9.3
8
+ - 2.0.0
9
+ - ruby-head
10
+ #- jruby-18mode
11
+ #- jruby-19mode
12
+ #- jruby-head
13
+ - rbx-18mode
14
+ - rbx-19mode
15
+ notifications:
16
+ recipients:
17
+ - ben@kree.gr
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in guard-cocoapods.gemspec
4
+ gemspec
data/Podfile ADDED
@@ -0,0 +1,2 @@
1
+ platform :ios
2
+ xcodeproj 'spec/fixtures/Project.xcodeproj'
@@ -0,0 +1 @@
1
+ COCOAPODS: 0.21.0.rc1
@@ -0,0 +1 @@
1
+ COCOAPODS: 0.21.0.rc1
@@ -0,0 +1,147 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>archiveVersion</key>
6
+ <string>1</string>
7
+ <key>classes</key>
8
+ <dict/>
9
+ <key>objectVersion</key>
10
+ <string>46</string>
11
+ <key>objects</key>
12
+ <dict>
13
+ <key>3CB4D04CEF1546B2850311D8</key>
14
+ <dict>
15
+ <key>buildConfigurations</key>
16
+ <array>
17
+ <string>EE2BC80B1E40436780CAAE15</string>
18
+ <string>A7B021CD44454943B4223A67</string>
19
+ </array>
20
+ <key>defaultConfigurationIsVisible</key>
21
+ <string>0</string>
22
+ <key>defaultConfigurationName</key>
23
+ <string>Release</string>
24
+ <key>isa</key>
25
+ <string>XCConfigurationList</string>
26
+ </dict>
27
+ <key>438D1DCA7F6E4980AEE1247C</key>
28
+ <dict>
29
+ <key>children</key>
30
+ <array/>
31
+ <key>isa</key>
32
+ <string>PBXGroup</string>
33
+ <key>name</key>
34
+ <string>Targets Support Files</string>
35
+ <key>sourceTree</key>
36
+ <string>&lt;group&gt;</string>
37
+ </dict>
38
+ <key>73A5549EBC524AE4B4791C48</key>
39
+ <dict>
40
+ <key>includeInIndex</key>
41
+ <string>1</string>
42
+ <key>isa</key>
43
+ <string>PBXFileReference</string>
44
+ <key>name</key>
45
+ <string>Podfile</string>
46
+ <key>path</key>
47
+ <string>../Podfile</string>
48
+ <key>sourceTree</key>
49
+ <string>SOURCE_ROOT</string>
50
+ <key>xcLanguageSpecificationIdentifier</key>
51
+ <string>xcode.lang.ruby</string>
52
+ </dict>
53
+ <key>7A5D003EE9CD4A1BA75CDC9F</key>
54
+ <dict>
55
+ <key>children</key>
56
+ <array/>
57
+ <key>isa</key>
58
+ <string>PBXGroup</string>
59
+ <key>name</key>
60
+ <string>Frameworks</string>
61
+ <key>sourceTree</key>
62
+ <string>&lt;group&gt;</string>
63
+ </dict>
64
+ <key>A7B021CD44454943B4223A67</key>
65
+ <dict>
66
+ <key>buildSettings</key>
67
+ <dict>
68
+ <key>IPHONEOS_DEPLOYMENT_TARGET</key>
69
+ <string>4.3</string>
70
+ </dict>
71
+ <key>isa</key>
72
+ <string>XCBuildConfiguration</string>
73
+ <key>name</key>
74
+ <string>Debug</string>
75
+ </dict>
76
+ <key>AD56CDF1CEFA4F16905FC57C</key>
77
+ <dict>
78
+ <key>attributes</key>
79
+ <dict>
80
+ <key>LastUpgradeCheck</key>
81
+ <string>0450</string>
82
+ </dict>
83
+ <key>buildConfigurationList</key>
84
+ <string>3CB4D04CEF1546B2850311D8</string>
85
+ <key>compatibilityVersion</key>
86
+ <string>Xcode 3.2</string>
87
+ <key>developmentRegion</key>
88
+ <string>English</string>
89
+ <key>hasScannedForEncodings</key>
90
+ <string>0</string>
91
+ <key>isa</key>
92
+ <string>PBXProject</string>
93
+ <key>knownRegions</key>
94
+ <array>
95
+ <string>en</string>
96
+ </array>
97
+ <key>mainGroup</key>
98
+ <string>F87EED4402F646E5A97E4152</string>
99
+ <key>productRefGroup</key>
100
+ <string>F4C09CD4E36743DCA1436994</string>
101
+ <key>projectReferences</key>
102
+ <array/>
103
+ <key>targets</key>
104
+ <array/>
105
+ </dict>
106
+ <key>EE2BC80B1E40436780CAAE15</key>
107
+ <dict>
108
+ <key>buildSettings</key>
109
+ <dict>
110
+ <key>IPHONEOS_DEPLOYMENT_TARGET</key>
111
+ <string>4.3</string>
112
+ </dict>
113
+ <key>isa</key>
114
+ <string>XCBuildConfiguration</string>
115
+ <key>name</key>
116
+ <string>Release</string>
117
+ </dict>
118
+ <key>F4C09CD4E36743DCA1436994</key>
119
+ <dict>
120
+ <key>children</key>
121
+ <array/>
122
+ <key>isa</key>
123
+ <string>PBXGroup</string>
124
+ <key>name</key>
125
+ <string>Products</string>
126
+ <key>sourceTree</key>
127
+ <string>&lt;group&gt;</string>
128
+ </dict>
129
+ <key>F87EED4402F646E5A97E4152</key>
130
+ <dict>
131
+ <key>children</key>
132
+ <array>
133
+ <string>7A5D003EE9CD4A1BA75CDC9F</string>
134
+ <string>F4C09CD4E36743DCA1436994</string>
135
+ <string>438D1DCA7F6E4980AEE1247C</string>
136
+ <string>73A5549EBC524AE4B4791C48</string>
137
+ </array>
138
+ <key>isa</key>
139
+ <string>PBXGroup</string>
140
+ <key>sourceTree</key>
141
+ <string>&lt;group&gt;</string>
142
+ </dict>
143
+ </dict>
144
+ <key>rootObject</key>
145
+ <string>AD56CDF1CEFA4F16905FC57C</string>
146
+ </dict>
147
+ </plist>
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,22 @@
1
+ # encoding: utf-8
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'guard/cocoapods'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "guard-cocoapods"
7
+ spec.version = Guard::CocoaPods::VERSION
8
+ spec.authors = ["Ben Kreeger"]
9
+ spec.email = ["ben@kree.gr"]
10
+ spec.description = 'A guard plugin for CocoaPods.'
11
+ spec.summary = 'A guard plugin for CocoaPods.'
12
+ spec.homepage = 'https://github.com/kreeger/guard-cocoapods'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_runtime_dependency 'guard', '~> 1.8.1'
21
+ spec.add_development_dependency 'rake', '~> 10.0.0'
22
+ end
@@ -0,0 +1,55 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+ class CocoaPods < Guard
6
+ VERSION = '0.0.1'
7
+
8
+ autoload :Notifier, 'guard/cocoapods/notifier'
9
+
10
+ def start
11
+ refresh_podfile
12
+ end
13
+
14
+ def reload
15
+ refresh_podfile
16
+ end
17
+
18
+ def run_all
19
+ refresh_podfile
20
+ end
21
+
22
+ def run_on_additions(paths = [])
23
+ refresh_podfile
24
+ end
25
+
26
+ def run_on_modifications(paths = [])
27
+ refresh_podfile
28
+ end
29
+
30
+ def cli?
31
+ !!options[:cli]
32
+ end
33
+
34
+ private
35
+
36
+ def refresh_podfile
37
+ if needs_refresh?
38
+ ::Guard::UI.info 'Refresh podfile', :reset => true
39
+ start_at = Time.now
40
+ # @result = Pod::Command::Install.new.run
41
+ @result = system("pod install#{" #{options[:cli]}" if options[:cli]}")
42
+ Notifier.notify(@result, Time.now - start_at)
43
+ @result
44
+ else
45
+ UI.info 'Podfile already up-to-date', :reset => true
46
+ Notifier.notify('up-to-date', nil)
47
+ true
48
+ end
49
+ end
50
+
51
+ def needs_refresh?
52
+ true
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,34 @@
1
+ # encoding: utf-8
2
+ module Guard
3
+ class CocoaPods
4
+ class Notifier
5
+ def self.guard_message(result, duration)
6
+ case result
7
+ when 'up-to-date'
8
+ "Podfile is already up-to-date"
9
+ when true
10
+ "Podfile has been installed\nin %.1f seconds." % [duration]
11
+ else
12
+ "Podfile can't be installed.\nPlease check this manually."
13
+ end
14
+ end
15
+
16
+ # failed | success
17
+ def self.guard_image(result)
18
+ icon = if result
19
+ :success
20
+ else
21
+ :failed
22
+ end
23
+ end
24
+
25
+ def self.notify(result, duration)
26
+ message = guard_message(result, duration)
27
+ image = guard_image(result)
28
+
29
+ ::Guard::Notifier.notify(message, :title => 'pod install', :image => image)
30
+ end
31
+
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,3 @@
1
+ guard 'cocoapods' do
2
+ watch('Podfile')
3
+ end
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Ben Kreeger
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,47 @@
1
+ # Guard::CocoaPods
2
+
3
+ A shameless ripoff of [Guard::Bundler](https://github.com/guard/guard-bundler), but adapted for [CocoaPods](http://cocoapods.org).
4
+
5
+ ## Install
6
+
7
+ Make sure you've got [Guard](https://github.com/guard/guard) installed beforehand. Then do one of these.
8
+
9
+ Command line version!
10
+
11
+ $ gem install guard-bundler
12
+
13
+ Gemfile version!
14
+
15
+ gem 'guard'
16
+ gem 'guard-cocoapods'
17
+
18
+ Then, run this command to add the guard definitions to your Guardfile.
19
+
20
+ $ guard init cocoapods
21
+
22
+ ## Usage
23
+
24
+ You'll want to consult the [Guard readme](https://github.com/guard/guard#usage) for this.
25
+
26
+ ## Guardfile
27
+
28
+ guard 'cocoapods' do
29
+ watch('Podfile')
30
+ end
31
+
32
+ If you want to read up more on Guard's DSL, check out the [Guardfile DSL section](https://github.com/guard/guard#guardfile-dsl) of their readme.
33
+
34
+ ## Development
35
+
36
+ Want to add something! Open a pull request! I prefer feature-named branches if you're wanting to make any changes.
37
+
38
+ I haven't added any testing to this repo since I was in a blitz to make it, but
39
+ if you want to go through and add test *for* me (apologies for my sloth and
40
+ apathy), I would love you forever.
41
+
42
+ ## Authors
43
+
44
+ - [Ben Kreeger](https://github.com/kreeger)
45
+ - Many thanks to [Yann Lugrin](https://github.com/yannlugrin) for `guard-bundler`
46
+ - Many thanks to [Soroush Khanlou](https://github.com/skhanlou) for the
47
+ inspiration
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-cocoapods
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ben Kreeger
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-06-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: guard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 1.8.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 1.8.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 10.0.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 10.0.0
41
+ description: A guard plugin for CocoaPods.
42
+ email:
43
+ - ben@kree.gr
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - .travis.yml
50
+ - Gemfile
51
+ - Podfile
52
+ - Podfile.lock
53
+ - Pods/Manifest.lock
54
+ - Pods/Pods.xcodeproj/project.pbxproj
55
+ - Rakefile
56
+ - guard-cocoapods.gemspec
57
+ - lib/guard/cocoapods.rb
58
+ - lib/guard/cocoapods/notifier.rb
59
+ - lib/guard/cocoapods/templates/Guardfile
60
+ - license.readme
61
+ - readme.markdown
62
+ homepage: https://github.com/kreeger/guard-cocoapods
63
+ licenses:
64
+ - MIT
65
+ metadata: {}
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 2.0.2
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: A guard plugin for CocoaPods.
86
+ test_files: []