Sha256: dfc1110ff02d633a7aacf83b983d8a464830df41f7bd87a3dd5900611ee95eae

Contents?: true

Size: 1.84 KB

Versions: 15

Compression:

Stored size: 1.84 KB

Contents

$:.push File.expand_path("../lib", __FILE__)

require "govuk_frontend_toolkit/version"

Gem::Specification.new do |s|
  s.name         = "govuk_frontend_toolkit"
  s.version      = GovUKFrontendToolkit.toolkit_version
  s.summary      = 'Tools for building frontend applications'
  s.authors      = ["Government Digital Service"]
  s.email        = ["govuk-dev@digital.cabinet-office.gov.uk"]
  s.homepage     = 'https://github.com/alphagov/govuk_frontend_toolkit'
  s.license      = 'MIT'

  s.add_dependency "rails", ">= 3.1.0"
  s.add_dependency "sass", ">= 3.2.0"
  s.add_development_dependency "gem_publisher", "1.3.1"
  s.add_development_dependency "rake", "0.9.2.2"

  s.require_paths = ["lib", "app"]
  s.files         = `git ls-files`.split($\)

  # We need to include the files from the submodules, example from:
  # http://somethingaboutcode.wordpress.com/2012/09/27/include-files-from-git-submodules-when-building-a-ruby-gem/

  gemroot_path = `pwd`.strip
  # get an array of submodule dirs by executing 'pwd' inside each submodule
  `git submodule --quiet foreach pwd`.split($\).each do |submodule_path|
    # for each submodule, change working directory to that submodule
    Dir.chdir(submodule_path) do

      # issue git ls-files in submodule's directory
      submodule_files = `git ls-files`.split($\)

      # prepend the submodule path to create absolute file paths
      submodule_files_fullpaths = submodule_files.map do |filename|
        "#{submodule_path}/#{filename}"
      end

      # remove leading path parts to get paths relative to the gem's root dir
      # (this assumes, that the gemspec resides in the gem's root dir)
      submodule_files_paths = submodule_files_fullpaths.map do |filename|
        filename.gsub "#{gemroot_path}/", ""
      end

      # add relative paths to gem.files
      s.files += submodule_files_paths
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
govuk_frontend_toolkit-5.0.3 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-5.0.2 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-5.0.1 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-5.0.0 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-4.18.4 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-4.18.3 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-4.18.2 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-4.18.1 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-4.18.0 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-4.17.0 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-4.16.1 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-4.16.0 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-4.15.0 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-4.14.1 govuk_frontend_toolkit.gemspec
govuk_frontend_toolkit-4.14.0 govuk_frontend_toolkit.gemspec