Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
copy default icon on init
Browse files Browse the repository at this point in the history
  • Loading branch information
weilu committed Jan 24, 2014
1 parent a63ede3 commit 1c63109
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
Binary file added assets/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion lib/hive/toolbelt.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/ruby
#!/usr/bin/env ruby

require "thor"
require "json"
Expand All @@ -20,6 +20,7 @@ def init
config[:repo_url] = ask("Git Repository URL: ")

create_manifest(config)
copy_default_icon
end

no_commands do
Expand All @@ -39,6 +40,12 @@ def id_for author, name
return "" if author.blank? || name.blank?
"#{author.parameterize('_')}.#{name.parameterize('_')}"
end

include Thor::Actions
def copy_default_icon
source_paths << 'assets'
copy_file 'images/icon.png', './icon.png'
end
end
end
end
Expand Down
16 changes: 15 additions & 1 deletion spec/lib/hive/toolbelt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Hive::Toolbelt

it 'creates a manifest file' do
cli.create_manifest
expect(File.exists?(filename))
expect(File.exists?(filename)).to be_true
end

def create_manifest_json config
Expand Down Expand Up @@ -38,5 +38,19 @@ def create_manifest_json config
File.delete filename if File.exists?(filename)
end
end

describe '#copy_default_icon' do
let(:cli) { described_class.new }
let(:filename) { 'icon.png' }

it 'provides a default icon file' do
cli.copy_default_icon
expect(File.exists?(filename)).to be_true
end

after do
File.delete filename if File.exists?(filename)
end
end
end
end

0 comments on commit 1c63109

Please sign in to comment.