Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Npm with node-check-updates #286

Merged
merged 3 commits into from
Mar 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ You can use these strategies:
- Bundler (Ruby)
- Carton (Perl)
- David (Node.js)
- npm-check-updates (Node.js)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to npm-check-updates from Npm.

- CocoaPods (Objective-C, Swift)
- Carthage (Swift)
- Composer (PHP)
Expand Down
14 changes: 14 additions & 0 deletions lib/tachikoma/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,20 @@ def cocoapods
end
end

def ncu
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed a method name to ncu from npm.

Dir.chdir("#{Tachikoma.repos_path}/#{@build_for}") do
sh(*['git', 'config', 'user.name', @commiter_name])
sh(*['git', 'config', 'user.email', @commiter_email])
sh(*['git', 'checkout', '-b', "tachikoma/update-#{@readable_time}", @base_remote_branch])
sh(*%w(ncu -u))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed execution for installation.

sh(*['git', 'add', 'package.json']) if File.exist?('package.json')
sh(*['git', 'commit', '-m', "Ncu update #{@readable_time}"]) do
# ignore exitstatus
end
sh(*['git', 'push', @authorized_compare_url, "tachikoma/update-#{@readable_time}"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pass array contents as separate arguments.

end
end

def pull_request
@client = Octokit::Client.new access_token: @github_token
@client.create_pull_request(
Expand Down
1 change: 1 addition & 0 deletions lib/tachikoma/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def self.help(shell, *)
rake tachikoma:run_composer # run tachikoma with composer
rake tachikoma:run_cocoapods # run tachikoma with cocoapods
rake tachikoma:run_carthage # run tachikoma with carthage
rake tachikoma:run_ncu # run tachikoma with npm-check-updates
USAGE
end

Expand Down
5 changes: 5 additions & 0 deletions lib/tasks/app.rake
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,9 @@ namespace :tachikoma do
task :run_carthage do
Tachikoma::Application.run 'carthage'
end

desc 'run tachikoma with npm-check-updates'
task :run_ncu do
Tachikoma::Application.run 'ncu'
end
end
13 changes: 13 additions & 0 deletions spec/tachikoma/application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@
end
end

context 'if strategy is `ncu`' do
before do
allow_any_instance_of(Tachikoma::Application).to receive(:load)
allow_any_instance_of(Tachikoma::Application).to receive(:fetch)
allow_any_instance_of(Tachikoma::Application).to receive(:pull_request)
end

it 'should be called `ncu` method' do
expect_any_instance_of(Tachikoma::Application).to receive(:ncu)
Tachikoma::Application.run 'ncu'
end
end

describe '#bundler_parallel_option' do
subject { described_class.new }

Expand Down