xclisten 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6ede9019aa6a994936841ce4d4ab7e11146f7de8
4
+ data.tar.gz: 2860261b1af428d7949a50c5d435fed3e0a8731d
5
+ SHA512:
6
+ metadata.gz: 276a55406746ec5937fb4ff4715fc3ec99b84f072df24a8b5868d3ee47ade20c0bf3670ebf208a6dea91c6be2aa71e259772e559bb9487c3d83b65f607b564d2
7
+ data.tar.gz: d47a48d20e6fe9a3052621df12c4284bd18a5852a5614c7f99c0eee375a02889764e3fbceab2771a1b6039a11637db1932be316c37055158e3329a1dbc1f276f
data/.gitignore ADDED
@@ -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
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in xclisten.gemspec
4
+ gemspec
5
+
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Marin Usalj
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.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # XCListen
2
+
3
+ A zero-configuration filesystem watcher for ObjectiveC.
4
+ It will:
5
+
6
+ - run tests each time you save a file
7
+ - install pods each time you save Podfile
8
+ - format your tests with RSpec-style output using [XCPretty](https://github.com/mneorr/xcpretty)
9
+
10
+
11
+ ## Installation
12
+
13
+ $ gem install xclisten
14
+
15
+ ## Usage
16
+
17
+ ```
18
+ $ xclisten
19
+ ```
20
+ Simple, huh?
21
+
22
+ ![](http://i.imgur.com/JpsMMBW.gif)
23
+
24
+ ## TODO
25
+
26
+ - Device flag (choose between iphone5s, iPad, iPad Air,...)
27
+
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/xclisten ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ if $0 == __FILE__
4
+ $:.unshift File.expand_path('../../lib', __FILE__)
5
+ end
6
+
7
+ require 'xclisten'
8
+ require 'listen'
9
+ require 'optparse'
10
+
11
+ OptionParser.new do |opts|
12
+ opts.banner = "Usage: xcodebuild [options] | xcpretty"
13
+ opts.on('--osx', 'Run with OSX sdk (without simulator)') do
14
+ XCListen::SDK = ''
15
+ end
16
+ opts.on('--ios', '[DEFAULT] Run with iOS sdk') do
17
+ XCListen::SDK = '-sdk iphonesimulator'
18
+ end
19
+ opts.on_tail('-h', '--help', 'Show this message') { puts opts; exit }
20
+ opts.on_tail("-v", "--version", "Show version") { puts XCListen::VERSION; exit }
21
+ opts.parse!
22
+ end
23
+
24
+ fork { XCListen.listen }
25
+ Process.wait
26
+
@@ -0,0 +1,3 @@
1
+ module XCListen
2
+ VERSION = "0.0.1"
3
+ end
data/lib/xclisten.rb ADDED
@@ -0,0 +1,51 @@
1
+ require "xclisten/version"
2
+ require 'listen'
3
+
4
+ module XCListen
5
+
6
+ module_function
7
+
8
+ SDK = '-sdk iphonesimulator'
9
+
10
+ def workspace_name
11
+ Dir.entries(Dir.pwd).detect { |f| f =~ /.xcworkspace/ }
12
+ end
13
+
14
+ def project_name
15
+ workspace_name.split('.').first
16
+ end
17
+
18
+ def xcodebuild
19
+ "xcodebuild -workspace #{workspace_name} -scheme #{project_name} #{SDK}"
20
+ end
21
+
22
+ def install_pods
23
+ system 'pod install'
24
+ puts 'Giving Xcode some time to index...'
25
+ sleep 10
26
+ end
27
+
28
+ def run_tests
29
+ task = "#{xcodebuild} test 2> xcodebuild_error.log | xcpretty -tc"
30
+ puts task + "\n\n"
31
+ system(task)
32
+ end
33
+
34
+ def listen
35
+ ignored = [/.git/, /.xc(odeproj|workspace|userdata|scheme|config)/, /.lock$/, /\.txt$/, /\.log$/]
36
+
37
+ listener = Listen.to(Dir.pwd, :ignore => ignored) do |modified, added, removed|
38
+ system 'clear'
39
+ if modified.first =~ /Podfile$/
40
+ install_pods
41
+ else
42
+ run_tests
43
+ end
44
+ end
45
+
46
+ listener.start
47
+ sleep
48
+ end
49
+
50
+ end
51
+
data/xclisten.gemspec ADDED
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'xclisten/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "xclisten"
8
+ spec.version = XCListen::VERSION
9
+ spec.authors = ["Marin Usalj"]
10
+ spec.email = ["mneorr@gmail.com"]
11
+ spec.summary = %q{Run ObjectiveC tests each time you hit save}
12
+ spec.description = %q{Zero configuration file watcher for Objective-C that runs tests, installs Pods each time you save a file}
13
+ spec.homepage = "https://github.com/mneorr/xclisten"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency "listen", "~> 2.4"
22
+ spec.add_runtime_dependency "xcpretty", "~> 0.1"
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.5"
25
+ end
26
+
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xclisten
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Marin Usalj
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: listen
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: xcpretty
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.5'
55
+ description: Zero configuration file watcher for Objective-C that runs tests, installs
56
+ Pods each time you save a file
57
+ email:
58
+ - mneorr@gmail.com
59
+ executables:
60
+ - xclisten
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - ".gitignore"
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - bin/xclisten
70
+ - lib/xclisten.rb
71
+ - lib/xclisten/version.rb
72
+ - xclisten.gemspec
73
+ homepage: https://github.com/mneorr/xclisten
74
+ licenses:
75
+ - MIT
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.2.0
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Run ObjectiveC tests each time you hit save
97
+ test_files: []