Sha256: da2c837e5ff11dc1df1ec2bbd19e102f59a70081d27c940c42b0b326e47ce3b8

Contents?: true

Size: 762 Bytes

Versions: 15

Compression:

Stored size: 762 Bytes

Contents

#!/usr/bin/env ruby
require 'thor'
require 'thor/actions'
require 'pry'



class Gem < Thor
  include Thor::Actions
  GEM_PATH = Dir.pwd
  desc "update TO VERSION", "say hello to NAME"
  def update(version)
    `cd ~ && mkdir d3_tmp && cd d3_tmp && git clone --branch v#{version} https://github.com/mbostock/d3.git`
    `cp ~/d3_tmp/d3/d3.js ./app/assets/javascripts/d3.js`
    `cp ~/d3_tmp/d3/d3.min.js ./app/assets/javascripts/d3.min.js`
    gsub_file("#{GEM_PATH}/lib/d3_rails/version.rb", /["']([^"']*)["']/, "'#{version}'")
    `gem build d3_rails.gemspec`
    `rm -rf ~/d3_tmp`
    push_to_rubygems = ask("push to rubygems?", limited_to: ["yes", "no"]) == "yes"
    if push_to_rubygems
      `gem push d3_rails-#{version}.gem`
    end
  end
end

Gem.start

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
d3_rails-4.1.1 tasks/gem.thor
d3_rails-4.1.0 tasks/gem.thor
d3_rails-4.0.0 tasks/gem.thor
d3_rails-3.5.17 tasks/gem.thor
d3_rails-3.5.16 tasks/gem.thor
d3_rails-3.5.15 tasks/gem.thor
d3_rails-3.5.14 tasks/gem.thor
d3_rails-3.5.13 tasks/gem.thor
d3_rails-3.5.12 tasks/gem.thor
d3_rails-3.5.11 tasks/gem.thor
d3_rails-3.5.10 tasks/gem.thor
d3_rails-3.5.9 tasks/gem.thor
d3_rails-3.5.8 tasks/gem.thor
d3_rails-3.5.7 tasks/gem.thor
d3_rails-3.4.13 tasks/gem.thor