Sha256: 4bcbfce56aa64f12000bdf8ad8623b3545e1f8a5225c3bc9f302b9e49ec3d3b0

Contents?: true

Size: 979 Bytes

Versions: 9

Compression:

Stored size: 979 Bytes

Contents

require 'rails/generators'

module Semantic
  module Generators
    class InstallGenerator < ::Rails::Generators::Base
      source_root File.expand_path("../templates", __FILE__)
      desc "This generator installs Semantic UI to Asset Pipeline"

      def add_assets
        # copy js manifest
        js_manifest = 'app/assets/javascripts/semantic-ui.js'

        if File.exist?(js_manifest)
          puts <<-EOM
          Notice:
            #{js_manifest} exist; skipping
          EOM
        else
          copy_file "semantic-ui.js", "app/assets/javascripts/semantic-ui.js"
        end

        # copy less manifests
        css_manifests = 'app/assets/stylesheets/semantic-ui.css.less'

        if File.exist?(css_manifests)
          puts <<-EOM
          Notice:
            #{css_manifests} exist; skipping
          EOM
        else
          copy_file "semantic-ui.css.less", "app/assets/stylesheets/semantic-ui.css.less"
        end

      end
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
semantic-ui-rails-0.8.4 lib/generators/semantic/install/install_generator.rb
semantic-ui-rails-0.8.3 lib/generators/semantic/install/install_generator.rb
semantic-ui-rails-0.8.2 lib/generators/semantic/install/install_generator.rb
semantic-ui-rails-0.8.1.1 lib/generators/semantic/install/install_generator.rb
semantic-ui-rails-0.8.1 lib/generators/semantic/install/install_generator.rb
semantic-ui-rails-0.7.2 lib/generators/semantic/install/install_generator.rb
semantic-ui-rails-0.6.5 lib/generators/semantic/install/install_generator.rb
semantic-ui-rails-0.3.5 lib/generators/semantic/install/install_generator.rb
semantic-ui-rails-0.1.0.2 lib/generators/semantic/install/install_generator.rb