Skip to content

Commit

Permalink
Initial commit!
Browse files Browse the repository at this point in the history
  • Loading branch information
segiddins committed Sep 13, 2014
0 parents commit 9b0dc0a
Show file tree
Hide file tree
Showing 23 changed files with 670 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/test/tmp/
/test/version_tmp/
/tmp/

## Specific to RubyMotion:
.dat*
.repl_history
build/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalisation:
/.bundle/
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "spec/resolver_integration_specs"]
path = spec/resolver_integration_specs
url = https://github.com/CocoaPods/Resolver-Integration-Specs.git
30 changes: 30 additions & 0 deletions .kick
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
recipe :ruby

Kicker::Recipes::Ruby.runner_bin = 'bacon --quiet'

process do |files|
specs = files.take_and_map do |file|
if file =~ %r{lib/[^/]*/(.+?)\.rb$}
s = Dir.glob("spec/**/#{File.basename(file, '.rb')}_spec.rb")
s.uniq unless s.empty?
end
end
Kicker::Recipes::Ruby.run_tests(specs)
end

# Have written this so many times, probably should make a recipe out of it.
process do |files|
files.each do |file|
case file
when 'Gemfile'
files.delete(file)
execute 'bundle install'
end
end
end

recipe :ignore
ignore(/.*\/?tags/)
ignore(/.*\/?\.git/)
ignore(/^tmp/)

8 changes: 8 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
inherit_from: .rubocop_cocoapods.yml

Metrics/LineLength:
Max: 120

AllCops:
Exclude:
- 'vendor/**/*'
89 changes: 89 additions & 0 deletions .rubocop_cocoapods.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
AllCops:
Include:
- ./Rakefile
- ./Gemfile
- ./*.gemspec
Exclude:
- ./spec/fixtures/**/*

# At the moment not ready to be used
# https://github.com/bbatsov/rubocop/issues/947
Documentation:
Enabled: false

#- CocoaPods -----------------------------------------------------------------#

# We adopted raise instead of fail.
SignalException:
EnforcedStyle: only_raise

# They are idiomatic
AssignmentInCondition:
Enabled: false

# Allow backticks
AsciiComments:
Enabled: false

# Indentation clarifies logic branches in implementations
IfUnlessModifier:
Enabled: false

# No enforced convention here.
SingleLineBlockParams:
Enabled: false

# We only add the comment when needed.
Encoding:
Enabled: false

# Having these make it easier to *not* forget to add one when adding a new
# value and you can simply copy the previous line.
TrailingComma:
EnforcedStyleForMultiline: comma

# Clashes with CLAide Command#validate!
GuardClause:
Enabled: false

# Not always desirable: lib/claide/command/plugins_helper.rb:12:15
Next:
Enabled: false

#- CocoaPods support for Ruby 1.8.7 ------------------------------------------#

HashSyntax:
EnforcedStyle: hash_rockets

Lambda:
Enabled: false

DotPosition:
EnforcedStyle: trailing

EachWithObject:
Enabled: false

Style/SpecialGlobalVars:
Enabled: false

#- CocoaPods specs -----------------------------------------------------------#

# Allow for `should.match /regexp/`.
AmbiguousRegexpLiteral:
Exclude:
- spec/**/*

# Allow `object.should == object` syntax.
Void:
Exclude:
- spec/**/*

ClassAndModuleChildren:
Exclude:
- spec/**/*

UselessComparison:
Exclude:
- spec/**/*

19 changes: 19 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
source 'https://rubygems.org'

gemspec

group :development do
gem 'bacon'
gem 'coveralls', :require => false
gem 'mocha', '~> 0.11.4'
gem 'mocha-on-bacon'
gem 'prettybacon'
gem 'kicker'
gem 'version_kit', :path => '../VersionKit'#:git => 'https://github.com/CocoaPods/VersionKit.git'

# Ruby 1.8.7 fixes
gem 'mime-types', '< 2.0'
if RUBY_VERSION >= '1.9.3'
gem 'rubocop'
end
end
91 changes: 91 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
PATH
remote: .
specs:
resolver (0.0.1)

PATH
remote: ../VersionKit
specs:
version_kit (0.0.1)

GEM
remote: https://rubygems.org/
specs:
ast (2.0.0)
astrolabe (1.3.0)
parser (>= 2.2.0.pre.3, < 3.0)
bacon (1.2.0)
coveralls (0.7.1)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
docile (1.1.5)
ffi (1.9.3)
kicker (3.0.0)
listen (~> 1.3.0)
notify (~> 0.5.2)
listen (1.3.1)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
rb-kqueue (>= 0.2)
metaclass (0.0.4)
mime-types (1.25.1)
mocha (0.11.4)
metaclass (~> 0.0.1)
mocha-on-bacon (0.2.1)
mocha (>= 0.9.8)
multi_json (1.10.1)
netrc (0.7.7)
notify (0.5.2)
parser (2.2.0.pre.4)
ast (>= 1.1, < 3.0)
slop (~> 3.4, >= 3.4.5)
powerpack (0.0.9)
prettybacon (0.0.2)
bacon (~> 1.2)
rainbow (2.0.0)
rake (10.3.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rb-kqueue (0.2.3)
ffi (>= 0.5.0)
rest-client (1.7.2)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rubocop (0.26.0)
astrolabe (~> 1.3)
parser (>= 2.2.0.pre.4, < 3.0)
powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4)
ruby-progressbar (1.5.1)
simplecov (0.9.0)
docile (~> 1.1.0)
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
slop (3.6.0)
term-ansicolor (1.3.0)
tins (~> 1.0)
thor (0.19.1)
tins (1.3.2)

PLATFORMS
ruby

DEPENDENCIES
bacon
bundler (~> 1.5)
coveralls
kicker
mime-types (< 2.0)
mocha (~> 0.11.4)
mocha-on-bacon
prettybacon
rake
resolver!
rubocop
version_kit!
9 changes: 9 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This project is licensed under the MIT license.

Copyright (c) 2014 Samuel E. Giddins segiddins@segiddins.me

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Empty file added README.md
Empty file.
67 changes: 67 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# encoding: utf-8

#-- Bootstrap --------------------------------------------------------------#

desc 'Initializes your working copy to run the specs'
task :bootstrap do
if system('which bundle')
title 'Installing gems'
sh 'bundle install'
else
$stderr.puts "\033[0;31m" \
"[!] Please install the bundler gem manually:\n" \
' $ [sudo] gem install bundler'
"\e[0m"
exit 1
end
end

begin
require 'bundler/gem_tasks'
task :default => :spec

#-- Specs ------------------------------------------------------------------#

desc 'Run specs'
task :spec do
title 'Running Unit Tests'
files = FileList['spec/**/*_spec.rb'].shuffle.join(' ')
sh "bundle exec bacon #{files}"

Rake::Task['rubocop'].invoke if RUBY_VERSION >= '1.9.3'
end

#-- Kick -------------------------------------------------------------------#

desc 'Automatically run specs for updated files'
task :kick do
exec 'bundle exec kicker -c'
end

#-- RuboCop ----------------------------------------------------------------#

if RUBY_VERSION >= '1.9.3'
require 'rubocop/rake_task'
RuboCop::RakeTask.new
end

rescue LoadError
$stderr.puts "\033[0;31m" \
'[!] Some Rake tasks haven been disabled because the environment' \
' couldn’t be loaded. Be sure to run `rake bootstrap` first.' \
"\e[0m"
$stderr.puts e.message
$stderr.puts e.backtrace
$stderr.puts
end

#-- Helpers ------------------------------------------------------------------#

def title(title)
cyan_title = "\033[0;36m#{title}\033[0m"
puts
puts '-' * 80
puts cyan_title
puts '-' * 80
puts
end
1 change: 1 addition & 0 deletions lib/resolver.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require 'resolver/gem_metadata'
3 changes: 3 additions & 0 deletions lib/resolver/gem_metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Resolver
VERSION = '0.0.1'
end
Loading

1 comment on commit 9b0dc0a

@fabiopelosin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call on the gem_metadata. The gem_version files in CocoaPods should be renamed to it imo.

Please sign in to comment.