rockstart-prefab 0.1.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 14ec42b28e5aecf3efcb220dbab73065e428f36261c64caf6b9297d966ae9079
4
+ data.tar.gz: 1e9406f652d0983a639aa5050eba3d6c58609a5cabe9811f0e51a17eacb9a8ac
5
+ SHA512:
6
+ metadata.gz: 35d9dcf3fa7e3064f471575c313784613cd115423a36ef9f19ccf5af9b215c4aa76d510f97863b6b6e8e5959566ec68fb2bb0008f959814d5f1a40818aab03bf
7
+ data.tar.gz: 85ff72312464bd15f182aa6238f558ce6fae0ce361971aa41438b98e54e308944abc54ee2e3b2870a3b7f84abf8c79538d4c78dfda59db060d3377c5faa6945a
@@ -0,0 +1,20 @@
1
+ Copyright 2020 Ben Morrall
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.
@@ -0,0 +1,38 @@
1
+ # Rockstart::Prefab
2
+ A collection of generators for creating pre-built components.
3
+
4
+ ## Usage
5
+ Each Prefabricated component is added to a Rails app by running the relevant generator.
6
+
7
+ Run a default build of rockstart before running these generators, as it assumes rockstart has or has not installed various features.
8
+
9
+ > bunlde exec rails generate rockstart
10
+
11
+ ### Sitemap
12
+
13
+ Generates a dynamic sitemap.xml
14
+
15
+ > bundle exec rails generate rockstart:perfab:sitemap
16
+
17
+ ## Installation
18
+ Add this line to your application's Gemfile:
19
+
20
+ ```ruby
21
+ gem 'rockstart-prefab'
22
+ ```
23
+
24
+ And then execute:
25
+ ```bash
26
+ $ bundle
27
+ ```
28
+
29
+ Or install it yourself as:
30
+ ```bash
31
+ $ gem install rockstart-prefab
32
+ ```
33
+
34
+ ## Contributing
35
+ Contribution directions go here.
36
+
37
+ ## License
38
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require "bundler/setup"
5
+ rescue LoadError
6
+ puts "You must `gem install bundler` and `bundle install` to run rake tasks"
7
+ end
8
+
9
+ require "rdoc/task"
10
+
11
+ RDoc::Task.new(:rdoc) do |rdoc|
12
+ rdoc.rdoc_dir = "rdoc"
13
+ rdoc.title = "Rockstart::Prefab"
14
+ rdoc.options << "--line-numbers"
15
+ rdoc.rdoc_files.include("README.md")
16
+ rdoc.rdoc_files.include("lib/**/*.rb")
17
+ end
18
+
19
+ require "bundler/gem_tasks"
20
+
21
+ require "rake/testtask"
22
+
23
+ Rake::TestTask.new(:test) do |t|
24
+ t.libs << "test"
25
+ t.pattern = "test/**/*_test.rb"
26
+ t.verbose = false
27
+ end
28
+
29
+ task default: :test
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Generates a dynamic sitemap.xml file
3
+
4
+ Example:
5
+ rails generate rockstart:development:sitemap
6
+
7
+ This will create:
8
+ Installs the sitemap_generator
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rockstart::Prefab
4
+ class SitemapGenerator < Rails::Generators::Base
5
+ source_root File.expand_path("templates", __dir__)
6
+
7
+ def add_sitemap_gem
8
+ gem "sitemap_generator"
9
+ end
10
+
11
+ def add_sitemap_config
12
+ copy_file "sitemap_config.rb", "config/sitemap.rb"
13
+ end
14
+
15
+ def add_release_step
16
+ append_to_file "bin/hooks-release", <<~'RELEASE' + "\n"
17
+
18
+ FileUtils.chdir APP_ROOT do
19
+ puts "== Generating Sitemap =="
20
+ system! "bundle exec rake sitemap:release"
21
+ end
22
+ RELEASE
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Set the host name for URL creation
4
+ SitemapGenerator::Sitemap.default_host = URI.parse("https://" + ENV["APP_HOST"]).to_s
5
+
6
+ if ENV["CLOUDCUBE_ACCESS_KEY_ID"].present?
7
+ require "aws-sdk-s3"
8
+
9
+ cloudcube_url = ENV.fetch("CLOUDCUBE_URL")
10
+ SitemapGenerator::Sitemap.adapter = SitemapGenerator::AwsSdkAdapter.new(
11
+ Utils::Cloudcube.bucket(cloudcube_url),
12
+ aws_access_key_id: ENV["CLOUDCUBE_ACCESS_KEY_ID"],
13
+ aws_secret_access_key: ENV.fetch("CLOUDCUBE_SECRET_ACCESS_KEY"),
14
+ aws_region: Utils::Cloudcube.region(cloudcube_url)
15
+ )
16
+ SitemapGenerator::Sitemap.sitemaps_host = File.join(cloudcube_url, "public")
17
+ SitemapGenerator::Sitemap.sitemaps_path = Utils::Cloudcube.public_prefix(cloudcube_url)
18
+ end
19
+
20
+ SitemapGenerator::Sitemap.create do
21
+ # Put links creation logic here.
22
+ #
23
+ # The root path '/' and sitemap index file are added automatically for you.
24
+ # Links are added to the Sitemap in the order they are specified.
25
+ #
26
+ # Usage: add(path, options={})
27
+ # (default options are used if you don't specify)
28
+ #
29
+ # Defaults: :priority => 0.5, :changefreq => 'weekly',
30
+ # :lastmod => Time.now, :host => default_host
31
+ #
32
+ # Examples:
33
+ #
34
+ # Add '/articles'
35
+ #
36
+ # add articles_path, :priority => 0.7, :changefreq => 'daily'
37
+ #
38
+ # Add all articles:
39
+ #
40
+ # Article.find_each do |article|
41
+ # add article_path(article), :lastmod => article.updated_at
42
+ # end
43
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rockstart/prefab/railtie"
4
+
5
+ module Rockstart
6
+ # Prefab Generators for making Rails Ready to Rock!
7
+ module Prefab
8
+ # Your code goes here...
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rockstart
4
+ module Prefab
5
+ class Railtie < ::Rails::Railtie
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rockstart
4
+ module Prefab
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+ # desc "Explaining what the task does"
3
+ # task :rockstart_prefab do
4
+ # # Task goes here
5
+ # end
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rockstart-prefab
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ben Morrall
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-05-04 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: 6.0.2
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 6.0.2.2
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: 6.0.2
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 6.0.2.2
33
+ - !ruby/object:Gem::Dependency
34
+ name: rockstart
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: sqlite3
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ description: A collection of generators for creating pre-built components.
62
+ email:
63
+ - bemo56@hotmail.com
64
+ executables: []
65
+ extensions: []
66
+ extra_rdoc_files: []
67
+ files:
68
+ - MIT-LICENSE
69
+ - README.md
70
+ - Rakefile
71
+ - lib/generators/rockstart/prefab/sitemap/USAGE
72
+ - lib/generators/rockstart/prefab/sitemap/sitemap_generator.rb
73
+ - lib/generators/rockstart/prefab/sitemap/templates/sitemap_config.rb
74
+ - lib/rockstart/prefab.rb
75
+ - lib/rockstart/prefab/railtie.rb
76
+ - lib/rockstart/prefab/version.rb
77
+ - lib/tasks/rockstart/prefab_tasks.rake
78
+ homepage: https://github.com/bmorrall/rockstart-prefab
79
+ licenses:
80
+ - MIT
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubygems_version: 3.1.2
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: Prefab content for getting Rails Ready to Rock!
101
+ test_files: []