Sha256: f3e73141542c1f6d53ff457e19a253cb5ff4aea0d94f288c3f967944c5983e8f

Contents?: true

Size: 563 Bytes

Versions: 24

Compression:

Stored size: 563 Bytes

Contents

class Kea::ServiceGenerator < Rails::Generators::NamedBase
  source_root File.expand_path('../templates', __FILE__)
  argument :namespace, type: :string, required: false, default: nil
  
  def install_templates
    template "service.js.erb", namespaced_path("app/assets/javascripts", "services/#{name.underscore}.js")
  end
  
    private
    
  def namespaced_path(path, suffix = nil)
    app_namespace = case namespace
    when 'none', nil
      nil
    else
      namespace.underscore
    end
    
    File.join [path, app_namespace, suffix].compact
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
kea-rails-1.0.9 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha14 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha13 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha12 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha11 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha10 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha9 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha8 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha7 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha6 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha5 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha4 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha3 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha2 lib/generators/kea/service/service_generator.rb
kea-rails-1.0.8 lib/generators/kea/service/service_generator.rb
kea-rails-2.0.0.pre.alpha1 lib/generators/kea/service/service_generator.rb
kea-rails-1.0.7 lib/generators/kea/service/service_generator.rb
kea-rails-1.0.6 lib/generators/kea/service/service_generator.rb
kea-rails-1.0.5 lib/generators/kea/service/service_generator.rb
kea-rails-1.0.4 lib/generators/kea/service/service_generator.rb