skeletor_cli 0.1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bin/skeletor +5 -0
- data/lib/skeletor_cli.rb +7 -0
- data/lib/skeletor_cli/cli.rb +40 -0
- data/lib/skeletor_cli/rails_builder.rb +16 -0
- data/lib/skeletor_cli/version.rb +3 -0
- metadata +122 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e8e9985e8921bc93188f5a1a443f2ddffd0fd78d
|
4
|
+
data.tar.gz: 128d11aea80bb70e58ff18fbc945f1d897610f40
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3332e8c0c4b398f17ab6f44f08c5688306489a6120ef36359e787efcff03e6af93c0e89c4e4d476d9bd42c907b1a387a2c8ec18ffb49d82e6a2fa00715069192
|
7
|
+
data.tar.gz: c36a970f62376b53f4903374a79bef72d803147c6470526729babbbad6a50be0ddd397e06bff84d434ed790b6cb56fac1b9c804c9efeb126abcbe9326095ef80
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "skeletor_cli"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/bin/skeletor
ADDED
data/lib/skeletor_cli.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'thor'
|
3
|
+
require 'skeletor_api'
|
4
|
+
|
5
|
+
module SkeletorCLI
|
6
|
+
class CLI < Thor
|
7
|
+
DEFAULT_CONFIG = ".skeletor"
|
8
|
+
class_option :config
|
9
|
+
|
10
|
+
def initialize(*args)
|
11
|
+
super(*args)
|
12
|
+
find_or_init_config
|
13
|
+
end
|
14
|
+
|
15
|
+
desc 'build SLUG APP_NAME', 'build the app from the specified skeleton'
|
16
|
+
def build(slug, app_name)
|
17
|
+
skeleton = @api_client.get_skeleton(slug)
|
18
|
+
RailsBuilder.build(skeleton, app_name)
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
def find_or_init_config
|
23
|
+
@config_file = options[:config] || File.join(ENV.fetch('HOME'), "#{DEFAULT_CONFIG}")
|
24
|
+
unless options[:config].nil? || File.exist?(options[:config])
|
25
|
+
puts "Could find config directory: #{options[:config_dir]}"
|
26
|
+
exit(1)
|
27
|
+
end
|
28
|
+
File.open(@config_file, 'w') {|f| f.write("api_key:\n")} unless File.exist?(@config_file)
|
29
|
+
@config = YAML.load_file(@config_file)
|
30
|
+
unless @config && @config['api_key'] && !@config['api_key'].empty?
|
31
|
+
puts "Could not find api key. Please add it to #{@config_file}"
|
32
|
+
exit(1)
|
33
|
+
end
|
34
|
+
SkeletorApi.configure do |config|
|
35
|
+
config.api_key = @config['api_key']
|
36
|
+
end
|
37
|
+
@api_client = SkeletorApi::Client.new
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'bundler/inline'
|
2
|
+
|
3
|
+
module SkeletorCLI
|
4
|
+
class RailsBuilder
|
5
|
+
def self.build(skeleton, app_name)
|
6
|
+
gemfile(true) do
|
7
|
+
source 'https://rubygems.org'
|
8
|
+
gem 'railties', skeleton[:gems][:rails][:version]
|
9
|
+
end
|
10
|
+
require 'rails/generators'
|
11
|
+
require 'rails/generators/rails/app/app_generator'
|
12
|
+
args = [app_name]
|
13
|
+
Rails::Generators::AppGenerator.start args
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: skeletor_cli
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dean
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-07-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: skeletor_api
|
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
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: thor
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: The cli tool for using skeletor app skeletons.
|
84
|
+
email:
|
85
|
+
- deangalvin3@gmail.com
|
86
|
+
executables:
|
87
|
+
- skeletor
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- bin/console
|
92
|
+
- bin/setup
|
93
|
+
- bin/skeletor
|
94
|
+
- lib/skeletor_cli.rb
|
95
|
+
- lib/skeletor_cli/cli.rb
|
96
|
+
- lib/skeletor_cli/rails_builder.rb
|
97
|
+
- lib/skeletor_cli/version.rb
|
98
|
+
homepage: https://www.github.com
|
99
|
+
licenses:
|
100
|
+
- MIT
|
101
|
+
metadata: {}
|
102
|
+
post_install_message:
|
103
|
+
rdoc_options: []
|
104
|
+
require_paths:
|
105
|
+
- lib
|
106
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
requirements: []
|
117
|
+
rubyforge_project:
|
118
|
+
rubygems_version: 2.5.1
|
119
|
+
signing_key:
|
120
|
+
specification_version: 4
|
121
|
+
summary: The cli tool for using skeletor app skeletons.
|
122
|
+
test_files: []
|