ecm_core_info_backend 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +17 -0
  5. data/app/assets/javascripts/ecm/core_info/backend/application.js +13 -0
  6. data/app/assets/javascripts/ecm_core_info_backend.js +1 -0
  7. data/app/assets/stylesheets/ecm/core_info/backend/application.css +14 -0
  8. data/app/assets/stylesheets/ecm_core_info_backend.css +3 -0
  9. data/app/controllers/ecm/core_info/backend/application_controller.rb +8 -0
  10. data/app/controllers/ecm/core_info/backend/engines_controller.rb +21 -0
  11. data/app/controllers/ecm/core_info/backend/gems_controller.rb +27 -0
  12. data/app/controllers/ecm/core_info/backend/home_controller.rb +4 -0
  13. data/app/helpers/ecm/core_info/backend/application_helper.rb +8 -0
  14. data/app/models/ecm/core_info/gem.rb +5 -0
  15. data/app/models/ecm/core_info/rails_engine.rb +29 -0
  16. data/app/serializers/ecm/core_info/gem_serializer.rb +34 -0
  17. data/app/serializers/ecm/core_info/rails_engine_serializer.rb +11 -0
  18. data/app/views/ecm/core_info/backend/engines/_table.haml +1 -0
  19. data/app/views/ecm/core_info/backend/gems/_table.html.haml +13 -0
  20. data/app/views/layouts/ecm/core_info/backend/application.html.erb +14 -0
  21. data/config/initializers/assets.rb +2 -0
  22. data/config/initializers/extensions.rb +9 -0
  23. data/config/locales/de.yml +6 -0
  24. data/config/locales/en.yml +6 -0
  25. data/config/routes.rb +6 -0
  26. data/lib/ecm/core_info/backend/configuration.rb +29 -0
  27. data/lib/ecm/core_info/backend/engine.rb +9 -0
  28. data/lib/ecm/core_info/backend/version.rb +7 -0
  29. data/lib/ecm/core_info/backend.rb +9 -0
  30. data/lib/ecm_core_info_backend.rb +2 -0
  31. data/lib/tasks/ecm/core_info/backend_tasks.rake +4 -0
  32. metadata +89 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 89da57759a8bb070de1a85509e551bafba38dac5
4
+ data.tar.gz: 19ebdfb2e16c59af0aca38fadab3026b1e30ee82
5
+ SHA512:
6
+ metadata.gz: c4d046c897f0f13e3b1af7d1254595d28a9939aa020be3e09210aad68ae44cb194b3f78369efc23e43bda1d19f6ca00d289883fbcb058fd5ba76861395b279fa
7
+ data.tar.gz: e10e5ad04391ac8b540258fd56e61a1ff461e773f208780e1fd142ba774d9b258370ae888f1310a2042a1631b04d3ce4b662b3782e8e1842c35a3d67664bfe60
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2016 Roberto Vasquez Angel
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = Ecm::CoreInfo::Backend
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Ecm::CoreInfo::Backend'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1 @@
1
+ //= require ecm/core_info/backend/application
@@ -0,0 +1,14 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. It is generally better to create a new file per style scope.
11
+ *
12
+ *= require_tree .
13
+ *= require_self
14
+ */
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require ecm/core_info/backend/application
3
+ */
@@ -0,0 +1,8 @@
1
+ module Ecm
2
+ module CoreInfo
3
+ module Backend
4
+ class ApplicationController < ActionController::Base
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,21 @@
1
+ module Ecm::CoreInfo::Backend
2
+ class EnginesController < Itsf::Backend::Resource::BaseController
3
+ def self.resource_class
4
+ Ecm::CoreInfo::RailsEngine
5
+ end
6
+
7
+ private
8
+
9
+ def collection_scope
10
+ if Itsf::Backend.features?(:kaminari)
11
+ Kaminari.paginate_array(resource_class.all)
12
+ else
13
+ super
14
+ end
15
+ end
16
+
17
+ def to_param_method
18
+ :class
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,27 @@
1
+ module Ecm::CoreInfo::Backend
2
+ class GemsController < Itsf::Backend::Resource::BaseController
3
+ using Ecm::CoreInfo
4
+
5
+ def self.resource_class
6
+ Ecm::CoreInfo::Gem
7
+ end
8
+
9
+ private
10
+
11
+ def to_param_method
12
+ :name
13
+ end
14
+
15
+ def collection_scope
16
+ if Itsf::Backend.features?(:kaminari)
17
+ Kaminari.paginate_array(resource_class.find_all.to_a)
18
+ else
19
+ super
20
+ end
21
+ end
22
+
23
+ def load_resource
24
+ resource_class.find_by_name(params[:id])
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,4 @@
1
+ module Ecm::CoreInfo::Backend
2
+ class HomeController < Itsf::Backend::HomeController
3
+ end
4
+ end
@@ -0,0 +1,8 @@
1
+ module Ecm
2
+ module CoreInfo
3
+ module Backend
4
+ module ApplicationHelper
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Ecm::CoreInfo
2
+ class Gem < ::Gem::Specification
3
+ include ActiveModel::Model
4
+ end
5
+ end
@@ -0,0 +1,29 @@
1
+ module Ecm::CoreInfo
2
+ class RailsEngine
3
+ include ActiveModel::Model
4
+
5
+ def self.attribute_names
6
+ %w(class app config env_config helpers routes initializers)
7
+ end
8
+
9
+ def self.all
10
+ ::Rails::Engine.subclasses.map(&:instance).sort_by { |obj| obj.class.name }
11
+ end
12
+
13
+ def self.count
14
+ all.count
15
+ end
16
+
17
+ def self.find(id)
18
+ all.find { |i| i.class.to_s == id }
19
+ end
20
+
21
+ def self.first
22
+ all.first
23
+ end
24
+
25
+ def self.last
26
+ all.last
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,34 @@
1
+ module Ecm::CoreInfo
2
+ class GemSerializer < ActiveModel::Serializer
3
+ attributes :authors,
4
+ :autorequire,
5
+ :bindir,
6
+ :cert_chain,
7
+ :date,
8
+ :dependencies,
9
+ :description,
10
+ :email,
11
+ :executables,
12
+ :extensions,
13
+ :extra_rdoc_files,
14
+ :files,
15
+ :homepage,
16
+ :licenses,
17
+ :metadata,
18
+ :name,
19
+ :platform,
20
+ :post_install_message,
21
+ :rdoc_options,
22
+ :require_paths,
23
+ :required_ruby_version,
24
+ :required_rubygems_version,
25
+ :requirements,
26
+ :rubyforge_project,
27
+ :rubygems_version,
28
+ :signing_key,
29
+ :specification_version,
30
+ :summary,
31
+ :test_files,
32
+ :version
33
+ end
34
+ end
@@ -0,0 +1,11 @@
1
+ module Ecm::CoreInfo
2
+ class RailsEngineSerializer < ActiveModel::Serializer
3
+ attributes :class,
4
+ :app,
5
+ :config,
6
+ :env_config,
7
+ :helpers,
8
+ :routes,
9
+ :initializers
10
+ end
11
+ end
@@ -0,0 +1 @@
1
+ = table.column(:name) { |engine| engine.class.name.gsub("::Engine", "") }
@@ -0,0 +1,13 @@
1
+ = table.column :name
2
+ = table.column :version, as: :string
3
+ = table.column :date
4
+ = table.column :summary
5
+ = table.column :licenses
6
+ = table.column(:homepage) { |gem| link_to(gem.homepage) if gem.homepage.present? }
7
+ = table.column :authors
8
+ = table.column(:email) { |gem| gem.email.respond_to?(:collect) ? gem.email.collect { |email| mail_to(email) }.to_sentence.html_safe : mail_to(gem.email) }
9
+ = table.column :requirements
10
+ = table.column :required_ruby_version, as: :string
11
+ = table.column :required_rubygems_version, as: :string
12
+ = table.column :platform
13
+ = table.column :executables
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Backend</title>
5
+ <%= stylesheet_link_tag "ecm/core_info/backend/application", media: "all" %>
6
+ <%= javascript_include_tag "ecm/core_info/backend/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,2 @@
1
+ Rails.application.config.assets.precompile += %w( ecm_core_info_backend.js )
2
+ Rails.application.config.assets.precompile += %w( ecm_core_info_backend.css )
@@ -0,0 +1,9 @@
1
+ if Rails.application.config.cache_classes
2
+ require_dependency Ecm::CoreInfo::Backend::Engine.root.join *%w(extensions bundler remote_specification_extension)
3
+ require_dependency Ecm::CoreInfo::Backend::Engine.root.join *%w(extensions rails engine_extension)
4
+ else
5
+ ActionDispatch::Callbacks.to_prepare do
6
+ require_dependency Ecm::CoreInfo::Backend::Engine.root.join *%w(extensions bundler remote_specification_extension)
7
+ require_dependency Ecm::CoreInfo::Backend::Engine.root.join *%w(extensions rails engine_extension)
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ de:
2
+ classes:
3
+ ecm/core_info/backend/engine: 'System Core Info'
4
+ routes:
5
+ mount:
6
+ ecm_core_info_backend: '/backend/core-info'
@@ -0,0 +1,6 @@
1
+ en:
2
+ classes:
3
+ ecm/core_info/backend/engine: 'System Core Info'
4
+ routes:
5
+ mount:
6
+ ecm_core_info_backend: '/backend/core-info'
data/config/routes.rb ADDED
@@ -0,0 +1,6 @@
1
+ Ecm::CoreInfo::Backend::Engine.routes.draw do
2
+ resources :engines, only: [:index, :show]
3
+ resources :gems, only: [:index, :show]
4
+
5
+ root to: 'home#index'
6
+ end
@@ -0,0 +1,29 @@
1
+ require 'active_support/core_ext/module/delegation'
2
+ require 'active_support/core_ext/module/attribute_accessors'
3
+
4
+ module Ecm
5
+ module CoreInfo
6
+ module Backend
7
+ module Configuration
8
+ def configure
9
+ yield self
10
+ end
11
+
12
+ mattr_accessor :registered_controllers do
13
+ lambda do
14
+ [
15
+ Ecm::CoreInfo::Backend::EnginesController,
16
+ Ecm::CoreInfo::Backend::GemsController
17
+ ]
18
+ end
19
+ end
20
+
21
+ mattr_accessor :registered_services do
22
+ lambda do
23
+ []
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,9 @@
1
+ module Ecm
2
+ module CoreInfo
3
+ module Backend
4
+ class Engine < ::Rails::Engine
5
+ isolate_namespace Ecm::CoreInfo::Backend
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ module Ecm
2
+ module CoreInfo
3
+ module Backend
4
+ VERSION = '0.0.2'.freeze
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ require 'ecm/core_info/backend/configuration'
2
+
3
+ module Ecm
4
+ module CoreInfo
5
+ module Backend
6
+ extend Configuration
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,2 @@
1
+ require 'ecm/core_info/backend'
2
+ require 'ecm/core_info/backend/engine'
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :backend do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ecm_core_info_backend
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Roberto Vasquez Angel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-03-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Ecm::CoreInfo::Backend Module.
28
+ email:
29
+ - roberto@vasquez-angel.de
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - MIT-LICENSE
35
+ - README.rdoc
36
+ - Rakefile
37
+ - app/assets/javascripts/ecm/core_info/backend/application.js
38
+ - app/assets/javascripts/ecm_core_info_backend.js
39
+ - app/assets/stylesheets/ecm/core_info/backend/application.css
40
+ - app/assets/stylesheets/ecm_core_info_backend.css
41
+ - app/controllers/ecm/core_info/backend/application_controller.rb
42
+ - app/controllers/ecm/core_info/backend/engines_controller.rb
43
+ - app/controllers/ecm/core_info/backend/gems_controller.rb
44
+ - app/controllers/ecm/core_info/backend/home_controller.rb
45
+ - app/helpers/ecm/core_info/backend/application_helper.rb
46
+ - app/models/ecm/core_info/gem.rb
47
+ - app/models/ecm/core_info/rails_engine.rb
48
+ - app/serializers/ecm/core_info/gem_serializer.rb
49
+ - app/serializers/ecm/core_info/rails_engine_serializer.rb
50
+ - app/views/ecm/core_info/backend/engines/_table.haml
51
+ - app/views/ecm/core_info/backend/gems/_table.html.haml
52
+ - app/views/layouts/ecm/core_info/backend/application.html.erb
53
+ - config/initializers/assets.rb
54
+ - config/initializers/extensions.rb
55
+ - config/locales/de.yml
56
+ - config/locales/en.yml
57
+ - config/routes.rb
58
+ - lib/ecm/core_info/backend.rb
59
+ - lib/ecm/core_info/backend/configuration.rb
60
+ - lib/ecm/core_info/backend/engine.rb
61
+ - lib/ecm/core_info/backend/version.rb
62
+ - lib/ecm_core_info_backend.rb
63
+ - lib/tasks/ecm/core_info/backend_tasks.rake
64
+ homepage: https://github.com/robotex82/ecm_core_info_backend
65
+ licenses:
66
+ - MIT
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.4.8
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: Ecm::CoreInfo::Backend.
88
+ test_files: []
89
+ has_rdoc: