franksi 1.0.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 359b552b04c8d0652e4ef648f98c615f86006487
4
+ data.tar.gz: c3d664e0a5c7bc5f62bfb2319fb6e7775832a3d8
5
+ SHA512:
6
+ metadata.gz: 589fa182ffaf62d5fbf0d385dd582df51ff5e1cbae842ceddab47956faed3b4688dbf1ffbb4e7eafe856112f9dd578c89e1f4586664ff2685722c870ab8f73f6
7
+ data.tar.gz: 68d87c93079a86b4dbe10038fd2149e58c9986253c52496c3ee5a86178a141edf3cb075a5ec6d26f8b01b351a229247267cb856415e279175f10bd4b2a6436a4
data/.DS_Store ADDED
Binary file
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in franksi.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Lais Varejão
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # Franksi
2
+
3
+ A command-line tool Sinatra app generator. Yes, there are similar existing gems, but *I did it my way*.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'franksi'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install franksi
20
+
21
+ ## Usage
22
+
23
+ Create a basic Sinatra project:
24
+
25
+ $ franksi new your-project
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it ( https://github.com/[my-github-username]/franksi/fork )
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/franksi ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../lib/franksi'
3
+
4
+ case ARGV[0]
5
+ when "new"
6
+ name = ARGV[1]
7
+ if name
8
+ Franksi::Project.new(name).create
9
+ STDOUT.puts "-- Project #{name} created"
10
+ else
11
+ puts "-- Command 'new' requires a value"
12
+ end
13
+ else
14
+ STDOUT.puts <<-EOF
15
+ Please provide command name
16
+
17
+ Usage:
18
+ franksi new project-name
19
+ EOF
20
+ end
data/franksi.gemspec ADDED
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'franksi/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "franksi"
8
+ spec.version = Franksi::VERSION
9
+ spec.authors = ["Lais Varejão"]
10
+ spec.email = ["laisvarejao@gmail.com"]
11
+ spec.summary = "A command-line tool Sinatra app generator."
12
+ spec.description = ""
13
+ spec.homepage = "https://github.com/laisvarejao/franksi"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ end
@@ -0,0 +1,3 @@
1
+ module Franksi
2
+ VERSION = "1.0.0"
3
+ end
data/lib/franksi.rb ADDED
@@ -0,0 +1,33 @@
1
+ require File.join(File.dirname(__FILE__), 'franksi/version')
2
+ require 'fileutils'
3
+
4
+ module Franksi
5
+
6
+ class Project
7
+
8
+ def initialize(name)
9
+ @name = name
10
+ end
11
+
12
+ def create
13
+ new_directory
14
+ copy_template
15
+ end
16
+
17
+ private
18
+
19
+ def new_directory
20
+ raise 'Directory exists' if File.exist?(@name)
21
+ Dir.mkdir @name
22
+ end
23
+
24
+ def copy_template
25
+ FileUtils.cp_r template_directory, @name
26
+ end
27
+
28
+ def template_directory
29
+ File.join(File.expand_path(File.dirname(__FILE__)), '/template/.')
30
+ end
31
+ end
32
+
33
+ end
@@ -0,0 +1,5 @@
1
+ # A sample Gemfile
2
+ source "https://rubygems.org"
3
+
4
+ # Use sinatra as the web framework
5
+ gem 'sinatra'
@@ -0,0 +1,17 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ rack (1.6.4)
5
+ rack-protection (1.5.3)
6
+ rack
7
+ sinatra (1.4.6)
8
+ rack (~> 1.4)
9
+ rack-protection (~> 1.4)
10
+ tilt (>= 1.3, < 3)
11
+ tilt (2.0.1)
12
+
13
+ PLATFORMS
14
+ ruby
15
+
16
+ DEPENDENCIES
17
+ sinatra
@@ -0,0 +1,5 @@
1
+ require 'tilt/erb'
2
+
3
+ get "/" do
4
+ erb :'index.html'
5
+ end
@@ -0,0 +1,4 @@
1
+ require 'sinatra'
2
+ require './app'
3
+
4
+ run Sinatra::Application
File without changes
File without changes
@@ -0,0 +1 @@
1
+ <p>Hello, Frank Sinatra</p>
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html lang='en'>
3
+ <head>
4
+
5
+ <meta charset='UTF-8' />
6
+ <title><%= @title %></title>
7
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
8
+ <link rel="stylesheet" href="/css/style.css">
9
+ <link rel="icon" href="/images/favicon.ico">
10
+
11
+ </head>
12
+
13
+ <body>
14
+ <%= yield %>
15
+ </body>
16
+
17
+ </html>
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: franksi
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Lais Varejão
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-09-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: ''
42
+ email:
43
+ - laisvarejao@gmail.com
44
+ executables:
45
+ - franksi
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".DS_Store"
50
+ - ".gitignore"
51
+ - Gemfile
52
+ - LICENSE.txt
53
+ - README.md
54
+ - Rakefile
55
+ - bin/franksi
56
+ - franksi.gemspec
57
+ - lib/franksi.rb
58
+ - lib/franksi/version.rb
59
+ - lib/template/Gemfile
60
+ - lib/template/Gemfile.lock
61
+ - lib/template/app.rb
62
+ - lib/template/config.ru
63
+ - lib/template/public/css/style.css
64
+ - lib/template/public/javascripts/script.js
65
+ - lib/template/views/index.html.erb
66
+ - lib/template/views/layout.html.erb
67
+ homepage: https://github.com/laisvarejao/franksi
68
+ licenses:
69
+ - MIT
70
+ metadata: {}
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubyforge_project:
87
+ rubygems_version: 2.4.6
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: A command-line tool Sinatra app generator.
91
+ test_files: []