custom_jekyll 0.1.0 → 0.2.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f87507e433e1d734e249ba8d98608f0103e74f9208715e6fea724151c5b8fac
4
- data.tar.gz: 1601f4b7866916c7bc620d934981b5ff7bafa04f6bd404030822befb4c7532c2
3
+ metadata.gz: '0759e9a944a62a33c6a48b9374e0e54443414312dc13e24ccbdc29c31b236754'
4
+ data.tar.gz: 99618685eed28a5fae44ce262e5601792b9f76a97c3776284221a54d6966f335
5
5
  SHA512:
6
- metadata.gz: fb4276f1fa7ec5bc77234dfe8fbff40e7f68abd689bf5d8410e12bb04b8c3debc64d87c3bb6710a77a25121f9d1620ab7ee49ba7c295683e4529b8764e9db981
7
- data.tar.gz: 34ec283a18660709f904babb09845fdfa92ba34ed8c9b40a18a22c3fd91dbc15c28fcb46287d5db200e5c0fe7d4792cf20ede84965725adb22af2681f5a3d62f
6
+ metadata.gz: 35229101c594c477c81ac702749b23f42c8334c6d7d089c13d2dfb048f22ca0f2d75f1b24ad230270e0072982f4441cd87e54aa5e217ca0391010ae130c402a3
7
+ data.tar.gz: 69c83218d94b904ecb13e2f3c0a22b7f31827d67cbf55fbe92893c2538b70712fab06372882fad646307e53a73da8c79be53f6bb47ec0b1993ddba65767ba927
@@ -0,0 +1,33 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ - name: Set up Ruby
24
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
25
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
26
+ # uses: ruby/setup-ruby@v1
27
+ uses: ruby/setup-ruby@21351ecc0a7c196081abca5dc55b08f085efe09a
28
+ with:
29
+ ruby-version: 2.6
30
+ - name: Install dependencies
31
+ run: bundle install
32
+ - name: Run tests
33
+ run: bundle exec rake
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- custom_jekyll (0.1.0)
4
+ custom_jekyll (0.2.4)
5
+ bundler (~> 1.17)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
@@ -31,7 +32,6 @@ PLATFORMS
31
32
  ruby
32
33
 
33
34
  DEPENDENCIES
34
- bundler (~> 1.17)
35
35
  custom_jekyll!
36
36
  pry (~> 0.13.1)
37
37
  rake (~> 10.0)
data/README.md CHANGED
@@ -1,29 +1,35 @@
1
1
  # CustomJekyll
2
+ The purpose of this gem is to make one's life easy while making any kind of site with jekyll. This gem is a mere generator that will generate all the files required for you to start any kind of static website using jekyll. Jekyll default generator is focused for blogs. I love to make different static websites and hosting them using github pages.
2
3
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/custom_jekyll`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+ Generate using CustomJekyll and have the basic structure for creating any kind of static website and then hosting it on GithubPages.
5
+
4
6
 
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'custom_jekyll'
7
+ ## Usage
8
+ ### Install
9
+ ```shell
10
+ $ gem install custom_jekyll
13
11
  ```
12
+ ### Generate a site
13
+ ```shell
14
+ $ custom_jekyll static-is-fun-with-jekyll
15
+ ```
16
+ then switch to it and start jekylling
14
17
 
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install custom_jekyll
22
-
23
- ## Usage
18
+ ```shell
19
+ $ cd static-is-fun-with-jekyll
20
+ $ bundle exec jekyll serve
21
+ ```
22
+ ### if you do not like the name custom_jekyll (I totally understand :P)
23
+ Add the following in your shell's profile
24
24
 
25
- TODO: Write usage instructions here
25
+ ```shell
26
+ alias cj="custom_jekyll"
27
+ ```
28
+ then
26
29
 
30
+ ```shell
31
+ $ cj learning-flexbox
32
+ ```
27
33
  ## Development
28
34
 
29
35
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -32,7 +38,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
38
 
33
39
  ## Contributing
34
40
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/custom_jekyll. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
41
+ Bug reports and pull requests are welcome on GitHub at https://github.com/aurangzaib-danial/custom_jekyll. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
42
 
37
43
  ## License
38
44
 
@@ -40,4 +46,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
40
46
 
41
47
  ## Code of Conduct
42
48
 
43
- Everyone interacting in the CustomJekyll project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/custom_jekyll/blob/master/CODE_OF_CONDUCT.md).
49
+ Everyone interacting in the CustomJekyll project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/aurangzaib-danial/custom_jekyll/blob/master/CODE_OF_CONDUCT.md).
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Aurangzaib"]
10
10
  spec.email = ["aurangzaib.danial@gmail.com"]
11
11
 
12
- spec.summary = "Need summary"
13
- spec.description = "Need description"
12
+ spec.summary = "Generate using CustomJekyll and have the basic structure for creating any kind of static website and then hosting it on GithubPages."
13
+ spec.description = "The purpose of this gem is to make one's life easy while making any kind of site with jekyll. This gem is a mere generator that will generate all the files required for you to start any kind of static website using jekyll. Jekyll default generator is focused for blogs. I love to make different static websites and hosting them using github pages. "
14
14
  spec.homepage = "https://github.com/aurangzaib-danial/custom_jekyll"
15
15
  spec.license = "MIT"
16
16
 
@@ -36,8 +36,10 @@ Gem::Specification.new do |spec|
36
36
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
37
  spec.require_paths = ["lib"]
38
38
 
39
- spec.add_development_dependency "bundler", "~> 1.17"
39
+ spec.required_ruby_version = ">= 2.4.0"
40
+
40
41
  spec.add_development_dependency "rake", "~> 10.0"
41
42
  spec.add_development_dependency "rspec", "~> 3.0"
42
43
  spec.add_development_dependency "pry", "~> 0.13.1"
44
+ spec.add_runtime_dependency "bundler", "~> 1.17"
43
45
  end
@@ -1,11 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "custom_jekyll/version"
2
4
  require 'custom_jekyll/command_line_controller'
3
5
  require 'custom_jekyll/generator'
4
-
6
+ require 'bundler'
5
7
 
6
8
  module CustomJekyll
7
9
  class Error < StandardError; end
8
10
  # Your code goes here...
9
11
  end
10
-
11
-
@@ -20,7 +20,9 @@ class CustomJekyll::Generator
20
20
 
21
21
  def generate_site
22
22
  copy_templates_to_new_site
23
+ change_directory_to_site
23
24
  run_automated_commands
25
+ add_site_name_to_site_config
24
26
  end
25
27
 
26
28
  def g_site_folder
@@ -32,29 +34,45 @@ class CustomJekyll::Generator
32
34
  end
33
35
 
34
36
  def run_automated_commands
35
- change_directory_to_site
36
37
  run_bundle_install
37
38
  make_git_repo
38
39
  end
39
40
 
40
- private
41
-
42
- def site_template
43
- self.class.path_to_site_template << '/.'
41
+ def add_site_name_to_site_config
42
+ config = File.read('_config.yml')
43
+ config.gsub!('%site_title%', humanize_site_name)
44
+ overwrite_config(config)
44
45
  end
45
46
 
46
47
  def change_directory_to_site
47
48
  Dir.chdir(site_name)
48
49
  end
49
50
 
51
+ private
52
+
53
+ def site_template
54
+ self.class.path_to_site_template << '/.'
55
+ end
56
+
50
57
  def run_bundle_install
51
58
  puts "Running bundle install in #{site_name}"
52
- ENV["BUNDLE_GEMFILE"] = File.expand_path('Gemfile')
53
- system("bundle install")
59
+ Bundler.with_clean_env do
60
+ system("bundle install")
61
+ end
54
62
  end
55
63
 
56
64
  def make_git_repo
57
65
  system("git init")
58
66
  end
67
+
68
+ def humanize_site_name
69
+ site_name.split(/-|\s/).map {|w| w.capitalize}.join("\s")
70
+ end
71
+
72
+ def overwrite_config(content)
73
+ File.open '_config.yml', 'w' do |f|
74
+ f.write content
75
+ end
76
+ end
59
77
 
60
78
  end
@@ -1,4 +1,4 @@
1
- title: 'TODO: Add awesome title'
1
+ title: %site_title%
2
2
  defaults:
3
3
  -
4
4
  scope:
@@ -1,3 +1,3 @@
1
1
  module CustomJekyll
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.4"
3
3
  end
data/notes.md CHANGED
@@ -15,3 +15,5 @@ Custom jekyll is a gem that will generate files that I require to start any kind
15
15
  TODO
16
16
  - [x] Set set_template according to your need.
17
17
  - [x] Run automated commands like bundle install, initialize git repository
18
+ - [x] edit config to include site_name
19
+ - [x] fix readme and gem description
metadata CHANGED
@@ -1,72 +1,76 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: custom_jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aurangzaib
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-22 00:00:00.000000000 Z
11
+ date: 2020-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.17'
19
+ version: '10.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.17'
26
+ version: '10.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '3.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '3.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: 0.13.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: 0.13.1
55
55
  - !ruby/object:Gem::Dependency
56
- name: pry
56
+ name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.13.1
62
- type: :development
61
+ version: '1.17'
62
+ type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.13.1
69
- description: Need description
68
+ version: '1.17'
69
+ description: 'The purpose of this gem is to make one''s life easy while making any
70
+ kind of site with jekyll. This gem is a mere generator that will generate all the
71
+ files required for you to start any kind of static website using jekyll. Jekyll
72
+ default generator is focused for blogs. I love to make different static websites
73
+ and hosting them using github pages. '
70
74
  email:
71
75
  - aurangzaib.danial@gmail.com
72
76
  executables:
@@ -74,9 +78,9 @@ executables:
74
78
  extensions: []
75
79
  extra_rdoc_files: []
76
80
  files:
81
+ - ".github/workflows/ruby.yml"
77
82
  - ".gitignore"
78
83
  - ".rspec"
79
- - ".travis.yml"
80
84
  - CODE_OF_CONDUCT.md
81
85
  - Gemfile
82
86
  - Gemfile.lock
@@ -120,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
124
  requirements:
121
125
  - - ">="
122
126
  - !ruby/object:Gem::Version
123
- version: '0'
127
+ version: 2.4.0
124
128
  required_rubygems_version: !ruby/object:Gem::Requirement
125
129
  requirements:
126
130
  - - ">="
@@ -130,5 +134,6 @@ requirements: []
130
134
  rubygems_version: 3.0.3
131
135
  signing_key:
132
136
  specification_version: 4
133
- summary: Need summary
137
+ summary: Generate using CustomJekyll and have the basic structure for creating any
138
+ kind of static website and then hosting it on GithubPages.
134
139
  test_files: []
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.6.6
7
- before_install: gem install bundler -v 1.17.2