tasks/gem/gem.rb in new-0.0.11 vs tasks/gem/gem.rb in new-0.0.12
- old
+ new
@@ -22,20 +22,22 @@
validate_files
render_gemspec_options
write_gemspec
write_config
deploy
+
+ New.say "Version #{project_options[:version].green} of the #{project_options[:project_name].green} gem successfully published."
end
private
def set_version
# bump version
- version = bump_version(project_options[:version], get_part).to_s
+ bump_version project_options[:version]
# set new version to config
- project_options[:version] = version
+ project_options[:version] = version.to_s
end
# Check that any glob pattern attributes match existing files
#
def validate_files
@@ -128,10 +130,12 @@
return array
end
def write_gemspec
+ New.say 'Updating `.gemspec` file...', type: :success
+
# process gemspec
interpolate File.join(File.dirname(__FILE__), '.gemspec.erb'), project_options
# copy it to the project
FileUtils.cp File.join(@dest_path, '.gemspec'), Dir.pwd
@@ -139,19 +143,24 @@
# cleanup the tmp
FileUtils.rm_rf @dest_path
end
def write_config
+ New.say 'Updating `.new` file...', type: :success
+
writeable_options = project_options.dup
writeable_options.delete(:gemspec_string)
GLOB_ATTRIBUTES.each{ |a| writeable_options.delete(a) }
File.open(New::CONFIG_FILE, 'w+') do |f|
f.write writeable_options.deep_stringify_keys.to_yaml
end
end
def deploy
+ New.say 'Pushing new gem version to rubygems...', type: :success
+ New.say ' ...This may take a bit', type: :warn
+
`gem update --system`
`gem build .gemspec`
`gem push #{@gemspec[:name]}-#{@gemspec[:version]}.gem`
FileUtils.rm_rf "#{@gemspec[:name]}-#{@gemspec[:version]}.gem"