Skip to content
This repository was archived by the owner on Apr 27, 2022. It is now read-only.

Commit efc976f

Browse files
committed
initial commit: rename later
1 parent d947496 commit efc976f

File tree

5 files changed

+60
-0
lines changed

5 files changed

+60
-0
lines changed

Gemfile

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
# the following line to use 'https'
33
source 'http://rubygems.org'
44

5+
# command line interface
6+
gem 'thor'
7+
8+
# environment
9+
gem 'dotenv'
10+
511
# Core
612
gem 'middleman', '~> 4.2.0'
713
gem 'middleman-autoprefixer', '~> 2.7.1'

Gemfile.lock

+2
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ PLATFORMS
160160
ruby
161161

162162
DEPENDENCIES
163+
dotenv
163164
middleman (~> 4.2.0)
164165
middleman-autoprefixer (~> 2.7.1)
165166
middleman-deploy!
@@ -172,6 +173,7 @@ DEPENDENCIES
172173
oga (~> 2.8)
173174
rake
174175
slim (~> 3.0.7)
176+
thor
175177

176178
BUNDLED WITH
177179
1.15.3

config.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
require 'dotenv/load'
12
require 'slim'
23

4+
activate :my_feature,
35
activate :autoprefixer, browsers: ['last 2 versions', 'ie 8', 'ie 9']
46
activate :livereload
57
activate :directory_indexes

lib/codeless_cli.rb

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env ruby
2+
3+
require "thor"
4+
5+
class CodelessCLI < Thor
6+
include Thor::Actions
7+
8+
desc 'getInfo', 'tell us your info'
9+
10+
def get_user_info
11+
say("\n\nHello, before we continue I need some information from you...\n\n\n")
12+
13+
[ 'name', 'github', 'twitter' ].each do |info|
14+
append_to_file '.env', "\n#{info.upcase}='#{ask("\n\nWhat is your #{info}?\n", :yellow)}'"
15+
end
16+
17+
say("\n\nComplete!\n\n", :green)
18+
end
19+
20+
end
21+
22+
CodelessCLI.start(ARGV)

lib/codeless_extension.rb

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
require 'codeless_cli'
2+
3+
class MyFeature < Middleman::Extension
4+
# All the options for this extension
5+
option :foo, false, 'Controls whether we foo'
6+
7+
def initialize(app, options_hash={}, &block)
8+
super
9+
10+
puts options.foo
11+
puts options.foo
12+
puts options.foo
13+
puts options.foo
14+
puts options.foo
15+
puts options.foo
16+
puts options.foo
17+
puts options.foo
18+
puts options.foo
19+
puts options.foo
20+
puts options.foo
21+
end
22+
23+
def after_build(builder)
24+
builder.thor.run './codeless_cli.rb'
25+
end
26+
end
27+
28+
::Middleman::Extensions.register(:my_feature, MyFeature)

0 commit comments

Comments
 (0)