Skip to content

Commit

Permalink
Merge branch 'master' into feature-non-version-dir-name
Browse files Browse the repository at this point in the history
* master:
  [travis-ci] Correctly set the LANG environment
  Trying to fix Travis build error with 'invalid byte sequence'
  Fix .travis.yml to add en_US.UTF8 locale
  Fixing Rakefile exception cases
  Fixing Rakefile's bootstrap
  [Specification::DSL] Introduce default_subspecs
  Update docs in DSL for podspec attribute.
  Fix wrong number on an issue reference in the changelog
  [DSL] Don't prepend the spec name to default_subspec
  Changelog and fixing a quote
  [Rubocop] Adding exclusion of `spec/fixtures/**` in the `.rubocop-cocoapods.yml` common rules config file even if it has to be repeated in the .rubocop.yml config file if we need to add other exclusions (like `lib/*/vendor/**`)
  [Rubocop] trying to split CocoaPods/Core specific rubocop rules and CP-common rules, so that we start using a common .rubocop-cocoapods.yml across all CP repos See discussion in CocoaPods/cocoapods-plugins#17
  Added missing space to acceptor
  Add labels to all the linter warnings and errors
  [Gemspec] Drop requirement for ActiveSupport < 4
  Simplify URL validation.
  Validate URIs before making requests, only catch SocketErrors.

Conflicts:
	CHANGELOG.md
  • Loading branch information
fabiopelosin committed May 19, 2014
2 parents 7269c76 + cdcfd10 commit c9b63cd
Show file tree
Hide file tree
Showing 21 changed files with 310 additions and 230 deletions.
61 changes: 61 additions & 0 deletions .rubocop-cocoapods.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
AllCops:
Include:
- Rakefile
Exclude:
- spec/fixtures/**

#- 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

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

HashSyntax:
EnforcedStyle: hash_rockets

Lambda:
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/**

70 changes: 7 additions & 63 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,14 @@
AllCops:
Include:
- Rakefile
Exclude:
- lib/cocoapods-core/vendor/**
- spec/fixtures/**

inherit_from: rubocop-todo.yml

#- 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

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

HashSyntax:
EnforcedStyle: hash_rockets

Lambda:
Enabled: false
inherit_from:
- rubocop-todo.yml
- .rubocop-cocoapods.yml

#- Core -----------------------------------------------------------------------

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

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

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

ClassAndModuleChildren:
AllCops:
Exclude:
- spec/**

#- Core -----------------------------------------------------------------------
- spec/fixtures/**
- lib/cocoapods-core/vendor/**

FileName:
Exclude:
- lib/cocoapods-core.rb

UselessComparison:
Exclude:
- spec/**

6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
language: ruby
bundler_args: --without debugging documentation

rvm:
- 1.8.7
- 1.9.3
- 2.0.0

env:
- LANG="en_US.UTF-8"

script: bundle exec rake spec

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
[Samuel E. Giddins](https://github.com/segiddins)
[#110](https://github.com/CocoaPods/Core/issues/110)

* Linter warnings and errors are now prefixed with \[`ATTRIBUTE_NAME`\].
This `ATTRIBUTE_NAME` specifies which property caused the error/warning.
[Joshua Kalpin][Kapin]
[#122](https://github.com/CocoaPods/Core/pull/122)

* Introduce a new spec attribute `default_subspecs`.
[Kyle Fuller][kylef]
[CocoaPods#2099](https://github.com/CocoaPods/CocoaPods/issues/2099)

## 0.32.1
## 0.32.0

Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gemspec

# Ruby 1.8.7
gem "mime-types", "< 2.0"
gem 'activesupport', '< 4'

group :development do
# Simplecov is affecting bacon exit code
Expand Down
3 changes: 2 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PATH
remote: .
specs:
cocoapods-core (0.32.1)
activesupport (>= 3.2.15, < 4)
activesupport (>= 3.2.15)
fuzzy_match (~> 2.0.4)
json_pure (~> 1.8)
nap (~> 0.5)
Expand Down Expand Up @@ -112,6 +112,7 @@ PLATFORMS
ruby

DEPENDENCIES
activesupport (< 4)
awesome_print
bacon
cocoapods-core!
Expand Down
159 changes: 91 additions & 68 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
require 'bundler/gem_tasks'

# Travis support
#-----------------------------------------------------------------------------#

def rvm_ruby_dir
@rvm_ruby_dir ||= File.expand_path('../..', `which ruby`.strip)
end

namespace :travis do
task :setup do
sh 'git submodule update --init'
sh "env CFLAGS='-I#{rvm_ruby_dir}/include' bundle install --without debugging documentation"
end
end

# Spec
#-----------------------------------------------------------------------------#

namespace :spec do
def specs(dir)
FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
end

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

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

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

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

Expand All @@ -44,43 +6,104 @@ task :bootstrap do
puts 'Updating submodules...'
`git submodule update --init --recursive`

puts 'Installing gems'
`bundle install`
end

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

# Coverage
#-----------------------------------------------------------------------------#

desc 'Generates & opens the coverage report'
task :coverage do
title 'Generating Coverage Report'
sh "env GENERATE_COVERAGE=true bundle exec bacon --quiet #{specs('**')}"
title 'Opening Report'
puts 'Coverage report available at `coverage/index.html`'
sh 'open coverage/index.html'
if system('which bundle')
puts 'Installing gems'
`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

# Rubocop
#-----------------------------------------------------------------------------#
begin

desc 'Checks code style'
task :rubocop do
if RUBY_VERSION >= '1.9.3'
require 'rubocop'
cli = Rubocop::CLI.new
result = cli.run
abort('RuboCop failed!') unless result == 0
else
puts '[!] Ruby > 1.9 is required to run style checks'
require 'bundler/gem_tasks'

# Travis support
#-----------------------------------------------------------------------------#

def rvm_ruby_dir
@rvm_ruby_dir ||= File.expand_path('../..', `which ruby`.strip)
end

namespace :travis do
task :setup do
sh 'git submodule update --init'
sh "env CFLAGS='-I#{rvm_ruby_dir}/include' bundle install --without debugging documentation"
end
end

# Spec
#-----------------------------------------------------------------------------#

namespace :spec do
def specs(dir)
FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
end

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

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

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



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

# Coverage
#-----------------------------------------------------------------------------#

desc 'Generates & opens the coverage report'
task :coverage do
title 'Generating Coverage Report'
sh "env GENERATE_COVERAGE=true bundle exec bacon --quiet #{specs('**')}"
title 'Opening Report'
puts 'Coverage report available at `coverage/index.html`'
sh 'open coverage/index.html'
end

# Rubocop
#-----------------------------------------------------------------------------#

desc 'Checks code style'
task :rubocop do
if RUBY_VERSION >= '1.9.3'
require 'rubocop'
cli = Rubocop::CLI.new
result = cli.run
abort('RuboCop failed!') unless result == 0
else
puts '[!] Ruby > 1.9 is required to run style checks'
end
end

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

task :default => :spec

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"
end

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

task :default => :spec
# Helpers
#-----------------------------------------------------------------------------#

def title(title)
cyan_title = "\033[0;36m#{title}\033[0m"
Expand Down
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.2.15', '< 4'
s.add_runtime_dependency 'activesupport', '>= 3.2.15'
s.add_runtime_dependency 'nap', "~> 0.5"
s.add_runtime_dependency "json_pure", "~> 1.8"
s.add_runtime_dependency 'fuzzy_match', "~> 2.0.4"
Expand Down

0 comments on commit c9b63cd

Please sign in to comment.