Skip to content

Commit

Permalink
Merge branch 'master' into similar-names-search
Browse files Browse the repository at this point in the history
* master: (32 commits)
  Fix Rubocop on older Rubies
  Fixed code style
  Complete migration to Rubocop
  Switched to RuboCop for code style checking
  [Specification] Fix vendored_frameworks showing as empty spec
  [Specification] Fix vendored_libraries showing as empty spec
  [Specification] Fix gist handling in linter
  [Bundle] Restore compatiblity with Ruby 1.8.7
  [Specification::Set] Improve required_by_logic
  [Rakefile] Minor fixes
  [Bundle] Update
  [Tailor] Improve settings
  Fix code style
  [Bundle] Update.
  Release 0.27.1
  [gemspec] Depend on pure Ruby version of json gem.
  [Bundle] Update
  Release 0.27.0
  [gemspec] Sync ActiveSupport dependency with CP gem.
  Rename run_all_specs_valudation_hooks to run_all_specs_validation_hooks
  ...

Conflicts:
	Gemfile.lock
	cocoapods-core.gemspec
  • Loading branch information
fabiopelosin committed Nov 6, 2013
2 parents fc9ce9f + 77399f2 commit 98ba01f
Show file tree
Hide file tree
Showing 44 changed files with 850 additions and 469 deletions.
71 changes: 71 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
HashSyntax:
EnforcedStyle: hash_rockets

StringLiterals:
Enabled: false
EnforcedStyle: double_quotes

SignalException:
EnforcedStyle: only_raise

ConstantName:
Enabled: false

IfUnlessModifier:
Enabled: false

EmptyLinesAroundBody:
Enabled: false

AsciiComments:
Enabled: false

Proc:
Enabled: false

BracesAroundHashParameters:
Enabled: false

Encoding:
Enabled: false

#------------------------------------------------------------------------------
# Needs fixing
#------------------------------------------------------------------------------

CyclomaticComplexity:
Max: 6
Max: 11

ClassLength:
Max: 100
Max: 300

MethodLength:
Max: 10
Max: 27

# Disabled because it includes comments
LineLength:
Enabled: false

#------------------------------------------------------------------------------
# $ rubocop lib --auto-gen-config
#
# Temporarily disabled cops, many of them do not work on the vendored classes.
#------------------------------------------------------------------------------

AssignmentInCondition:
Enabled: false

Documentation:
Enabled: false

RescueException:
Enabled: false

SingleLineMethods:
Enabled: false

TrivialAccessors:
Enabled: false
7 changes: 6 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ source "http://rubygems.org"

gemspec

# Ruby 1.8.7
gem "mime-types", "< 2.0"

group :development do
gem 'coveralls', :require => false
gem "mocha", "~> 0.11.4"
gem "bacon"
gem "mocha-on-bacon"
gem "rake"
gem 'prettybacon', :git => 'https://github.com/irrationalfab/PrettyBacon.git', :branch => 'master'
if RUBY_VERSION >= '1.9.3'
gem 'rubocop'
end
end

group :debugging do
Expand All @@ -24,4 +30,3 @@ group :documentation do
gem 'github-markup'
gem 'pygments.rb'
end

30 changes: 21 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ GIT
PATH
remote: .
specs:
cocoapods-core (0.26.2)
activesupport (~> 3.0)
cocoapods-core (0.27.1)
activesupport (>= 3.2.15, < 4)
fuzzy_match (~> 2.0.4)
json (~> 1.8)
nap (~> 0.5)

GEM
remote: http://rubygems.org/
specs:
activesupport (3.2.14)
activesupport (3.2.15)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
ast (1.1.0)
awesome_print (1.2.0)
bacon (1.2.0)
coderay (1.0.9)
Expand All @@ -39,11 +40,11 @@ GEM
simplecov (>= 0.7)
term-ansicolor
thor
ffi (1.9.0)
ffi (1.9.3)
fuzzy_match (2.0.4)
github-markup (0.7.5)
i18n (0.6.5)
json (1.8.0)
json (1.8.1)
listen (1.3.1)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
Expand All @@ -55,17 +56,22 @@ GEM
metaclass (~> 0.0.1)
mocha-on-bacon (0.2.1)
mocha (>= 0.9.8)
multi_json (1.8.1)
multi_json (1.8.2)
nap (0.5.1)
notify (0.5.2)
parser (2.0.0)
ast (~> 1.1)
slop (~> 3.4, >= 3.4.5)
posix-spawn (0.3.6)
powerpack (0.0.9)
pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
pygments.rb (0.5.2)
pygments.rb (0.5.4)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
rainbow (1.1.4)
rake (10.1.0)
rb-fsevent (0.9.3)
rb-inotify (0.9.2)
Expand All @@ -75,6 +81,10 @@ GEM
redcarpet (3.0.0)
rest-client (1.6.7)
mime-types (>= 1.16)
rubocop (0.15.0)
parser (~> 2.0)
powerpack (~> 0.0.6)
rainbow (>= 1.1.4)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
Expand All @@ -83,9 +93,9 @@ GEM
term-ansicolor (1.2.2)
tins (~> 0.8)
thor (0.18.1)
tins (0.11.0)
tins (0.12.0)
yajl-ruby (1.1.0)
yard (0.8.7.2)
yard (0.8.7.3)

PLATFORMS
ruby
Expand All @@ -97,6 +107,7 @@ DEPENDENCIES
coveralls
github-markup
kicker!
mime-types (< 2.0)
mocha (~> 0.11.4)
mocha-on-bacon
prettybacon!
Expand All @@ -105,4 +116,5 @@ DEPENDENCIES
rake
rb-fsevent
redcarpet
rubocop
yard
47 changes: 40 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ namespace :gem do
end

def silent_sh(command)
require 'english'
output = `#{command} 2>&1`
unless $?.success?
unless $CHILD_STATUS.success?
puts output
exit 1
end
Expand Down Expand Up @@ -117,15 +118,20 @@ namespace :spec do

task :all do
ENV['GENERATE_COVERAGE'] = 'true'

title "Running Unit Tests"
sh "bundle exec bacon #{specs('**')}"

title "Checking code style..."
Rake::Task["rubocop"].invoke
end

desc "Checks that the gem is campable of loading all the specs of the master repo."
desc "Checks that the gem is capable of loading all the specs of the master repo."
task :repo do
puts "Checking compatibility with master repo"
require 'pathname'
root = Pathname.new(File.expand_path('../', __FILE__))
$:.unshift((root + 'lib').to_s)
$LOAD_PATH.unshift((root + 'lib').to_s)
require 'cocoapods-core'

master_repo_path = ENV['HOME'] + "/.cocoapods/master"
Expand All @@ -147,7 +153,7 @@ namespace :spec do
puts "\e[0m\n"
puts e.message
puts
puts e.backtrace.reject { |l| !l.include?(Dir.pwd) || l.include?('/Rakefile')}
puts e.backtrace.reject { |l| !l.include?(Dir.pwd) || l.include?('/Rakefile') }
FALSE
end
end
Expand All @@ -160,8 +166,11 @@ namespace :spec do
spec_with_errors_count += 1
puts "\n#{s.name} #{s.version}"
results = linter.errors.map do |r|
if r.type == :error then "\e[1;33m #{r.to_s}\e[0m"
else " " + r.to_s end
if r.type == :error
"\e[1;33m #{r.to_s}\e[0m"
else
" " + r.to_s
end
end
puts results * "\n"
end
Expand Down Expand Up @@ -189,8 +198,32 @@ task :bootstrap do
`bundle install`
end


desc "Run all specs"
task :spec => 'spec:all'

#-----------------------------------------------------------------------------#

desc 'Checks code style'
task :rubocop do
if RUBY_VERSION >= '1.9.3'
require 'rubocop'
cli = Rubocop::CLI.new
result = cli.run(FileList['lib/**/*.rb'].exclude('lib/cocoapods-core/vendor/**/*').to_a)
abort('RuboCop failed!') unless result == 0
else
puts "[!] Ruby > 1.9 is required to run style checks"
end
end

#-----------------------------------------------------------------------------#

task :default => :spec

def title(title)
cyan_title = "\033[0;36m#{title}\033[0m"
puts
puts "-" * 80
puts cyan_title
puts "-" * 80
puts
end
2 changes: 1 addition & 1 deletion cocoapods-core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.files = Dir["lib/**/*.rb"] + %w{ README.md LICENSE }
s.require_paths = %w{ lib }

s.add_runtime_dependency 'activesupport', '~> 3.0'
s.add_runtime_dependency 'activesupport', '>= 3.2.15', '< 4'
s.add_runtime_dependency 'nap', "~> 0.5"
s.add_runtime_dependency "json", "~> 1.8"
s.add_runtime_dependency 'fuzzy_match', "~> 2.0.4"
Expand Down
2 changes: 0 additions & 2 deletions lib/cocoapods-core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,3 @@ class Informative < PlainInformative; end
Spec = Specification

end


1 change: 0 additions & 1 deletion lib/cocoapods-core/core_ui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ def self.warn(message)

end
end

Loading

0 comments on commit 98ba01f

Please sign in to comment.