Sha256: 914b17b13caad6d751f03cded53967b74fd844a741657b551c8d8bb1e01316aa

Contents?: true

Size: 782 Bytes

Versions: 22

Compression:

Stored size: 782 Bytes

Contents

require 'find'
require 'json'
require 'pathname'

namespace :bower do

  find_files = ->(path) {
    Find.find(Pathname.new(path).relative_path_from(Pathname.new Dir.pwd).to_s).map do |path|
      path if File.file?(path)
    end.compact
  }

  desc 'update main and version in bower.json'
  task :generate do
    require 'bootstrap-sass'
    Dir.chdir Bootstrap.gem_path do
      spec       = JSON.parse(File.read 'bower.json')

      spec['main'] =
          find_files.(File.join(Bootstrap.stylesheets_path, '_bootstrap.scss')) +
          find_files.(Bootstrap.fonts_path) +
          %w(assets/javascripts/bootstrap.js)

      spec['version'] = Bootstrap::VERSION

      File.open('bower.json', 'w') do |f|
        f.puts JSON.pretty_generate(spec)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 5 rubygems

Version Path
entreprise7pro-bootstrap-sass-3.4.7 tasks/bower.rake
entreprise7pro-bootstrap-sass-3.4.6 tasks/bower.rake
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/tasks/bower.rake
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/tasks/bower.rake
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/tasks/bower.rake
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/tasks/bower.rake
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/tasks/bower.rake
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/tasks/bower.rake
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/tasks/bower.rake
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/tasks/bower.rake
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/tasks/bower.rake
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/tasks/bower.rake
bootstrap-sass-3.4.1 tasks/bower.rake
bootstrap-sass-3.4.0 tasks/bower.rake
bootstrap-sass-3.3.7 tasks/bower.rake
style-sass-1.0.0 tasks/bower.rake
bootstrap-sass-3.3.6 tasks/bower.rake
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/bootstrap-sass-3.3.5.1/tasks/bower.rake
bootstrap-sass-3.3.5.1 tasks/bower.rake
bootstrap-sass-3.3.5 tasks/bower.rake