Skip to content

Commit

Permalink
Issues #19 #20 #21 Create a gem
Browse files Browse the repository at this point in the history
- Generate Rails 4.x
- Add README.md
- Remove public/index.html
- Remove README.rdoc
  • Loading branch information
Onur Özgür ÖZKAN committed May 6, 2013
1 parent eca13d5 commit 282b70c
Show file tree
Hide file tree
Showing 11 changed files with 228 additions and 16 deletions.
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in cybele.gemspec
gemspec
90 changes: 90 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
PATH
remote: .
specs:
cybele (0.1.0)
bundler (~> 1.3)
rails (= 4.0.0.rc1)

GEM
remote: https://rubygems.org/
specs:
actionmailer (4.0.0.rc1)
actionpack (= 4.0.0.rc1)
mail (~> 2.5.3)
actionpack (4.0.0.rc1)
activesupport (= 4.0.0.rc1)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.0.rc1)
activesupport (= 4.0.0.rc1)
builder (~> 3.1.0)
activerecord (4.0.0.rc1)
activemodel (= 4.0.0.rc1)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.0.rc1)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.2)
activesupport (4.0.0.rc1)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.0)
atomic (1.1.8)
builder (3.1.4)
erubis (2.7.0)
hike (1.2.2)
i18n (0.6.4)
mail (2.5.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.23)
minitest (4.7.4)
multi_json (1.7.2)
polyglot (0.3.3)
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.0.0.rc1)
actionmailer (= 4.0.0.rc1)
actionpack (= 4.0.0.rc1)
activerecord (= 4.0.0.rc1)
activesupport (= 4.0.0.rc1)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.0.rc1)
sprockets-rails (~> 2.0.0.rc4)
railties (4.0.0.rc1)
actionpack (= 4.0.0.rc1)
activesupport (= 4.0.0.rc1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.0.4)
sprockets (2.9.3)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.0.0.rc4)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
thor (0.18.1)
thread_safe (0.1.0)
atomic
tilt (1.4.0)
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.37)

PLATFORMS
ruby

DEPENDENCIES
bundler (~> 1.3)
cybele!
rake
22 changes: 22 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2013 lab2023 - internet technologies

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 changes: 6 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Cybele

This is yet an other private Rails Template.
NOTE: Don't use this gem until v1.0.0

This is yet an other Rails Template which inspired from [Syspenders](https://github.com/thoughtbot/suspenders)

**Cybele** pron.: /ˈsɪbɨliː/ was an originally Anatolian mother goddess. Little is known of her oldest Anatolian cults, other than her association with mountains, hawks and lions. She may have been Phrygia's State deity; her Phrygian cult was adopted and adapted by Greek colonists of Asia Minor, and spread from there to mainland Greece and its more distant western colonies from around the 6th century BCE.

Expand All @@ -14,22 +16,10 @@ Before generating your application, you will need:
## Usage

```ruby
rails new APP_NAME -T -m https://raw.github.com/lab2023/cybele/master/rails_template.rb
cybele PROJECT_NAME
```

## What cybele included?

**Default**

* [simple_form](https://github.com/plataformatec/simple_form)
* [responders](https://github.com/plataformatec/responders)
* [devise](https://github.com/plataformatec/devise) for super admin
* unicorn_template See [issue #4](https://github.com/lab2023/cybele/issues/4#issuecomment-15001981)

**Optional**

* [devise](https://github.com/plataformatec/devise) for user model. See [issue #2 comment](https://github.com/lab2023/cybele/issues/2#issuecomment-14980353)

## What cybele do and included?


## Bugs and Feedback
Expand All @@ -50,7 +40,7 @@ Once you've made your great commits:

## Credits

Rails Template is maintained and funded by [lab2023 - internet technologies](http://lab2023.com/)
Cybele is maintained and funded by [lab2023 - internet technologies](http://lab2023.com/)

Thank you to all the [contributors!](https://github.com/lab2023/cybele/graphs/contributors)

Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require "bundler/gem_tasks"
9 changes: 9 additions & 0 deletions bin/cybele
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env ruby

require File.expand_path(File.join('..', 'lib', 'cybele', 'generators', 'app_generator'), File.dirname(__FILE__))
require File.expand_path(File.join('..', 'lib', 'cybele', 'app_builder'), File.dirname(__FILE__))

templates_root = File.expand_path(File.join("..", "templates"), File.dirname(__FILE__))
Cybele::AppGenerator.source_root templates_root
Cybele::AppGenerator.source_paths << Rails::Generators::AppGenerator.source_root << templates_root
Cybele::AppGenerator.start
29 changes: 29 additions & 0 deletions cybele.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'cybele/version'

Gem::Specification.new do |spec|
spec.name = 'cybele'
spec.version = Cybele::VERSION
spec.authors = %w[lab2023]
spec.email = %w[[email protected]]
spec.description = %q{Yet another rails template gem}
spec.summary = %q{Yet another rails template gem}
spec.homepage = 'https://github.com/lab2023/cybele'
spec.license = 'MIT'

spec.required_ruby_version = '>= 2.0.0'
spec.add_dependency 'bundler', '~> 1.3'
spec.add_dependency 'rails', '4.0.0.rc1'

spec.files = `git ls-files`.split($/)
spec.executables = %w[cybele]
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = %w[lib]

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"

spec.extra_rdoc_files = %w[README.md LICENSE.txt]
end
22 changes: 22 additions & 0 deletions lib/cybele/app_builder.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module Cybele
class AppBuilder < Rails::AppBuilder

include Thor::Actions
include Thor::Shell

def add_readme_md
template 'README.md.erb', 'README.md', :force => true
end

def remove_public_index
say 'public'
remove_file 'public/index.html'
end

def remove_readme_rdoc
say 'readme'
remove_file 'README.rdoc'
end

end
end
40 changes: 40 additions & 0 deletions lib/cybele/generators/app_generator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
require 'rails/generators'
require 'rails/generators/rails/app/app_generator'

module Cybele
class AppGenerator < Rails::Generators::AppGenerator
class_option :database, :type => :string, :aliases => '-d', :default => 'postgresql',
:desc => "Preconfigure for selected database (options: #{DATABASES.join('/')})"

class_option :skip_test_unit, :type => :boolean, :aliases => '-T', :default => true,
:desc => 'Skip Test::Unit files'

def finish_template
invoke :customization
super
end

def customization
invoke :add_readme_md
invoke :remove_files_we_dont_need
end

def add_readme_md
say 'Add README.md'
build :readme
end

def remove_files_we_dont_need
say 'Remove files we don\'t need'
build :remove_public_index
build :remove_readme_rdoc
end

protected

def get_builder_class
Cybele::AppBuilder
end

end
end
3 changes: 3 additions & 0 deletions lib/cybele/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Cybele
VERSION = '0.1.0'
end
2 changes: 2 additions & 0 deletions templates/README.md.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# <%= app_name %>

0 comments on commit 282b70c

Please sign in to comment.