silica 0.1.0
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/silica +7 -0
- data/lib/silica.rb +5 -0
- data/lib/silica/cli.rb +23 -0
- data/lib/silica/version.rb +3 -0
- data/template/project/Gemfile +15 -0
- data/template/project/Rakefile +7 -0
- data/template/project/app/application.rb +11 -0
- data/template/project/assets/css/application.scss +0 -0
- data/template/project/config.ru +35 -0
- data/template/project/server.rb +33 -0
- data/template/project/views/index.haml +9 -0
- metadata +129 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 535fa48d77ba3112c76d4f6ade8766d1de2746a7
|
4
|
+
data.tar.gz: 822dbc2db78b24ef359b71f19830c8240cc369df
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1b39dbb25ec94c00e2ed1e039c34515bc4095d37bffe3a7af2ac334907bf6abd7387107140fe0fd69ea847fda5eea482535df810f942b6d44e2d9d55b1e30445
|
7
|
+
data.tar.gz: e3b821fca81c4115686afca2b6472d0c3a197a889cb897b1ab14d215c84d8dd2e6d137db770beaa73ce6cc39ae9ee6f6dff596f39a62afa7f4cce7883d26f486
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "silica"
|
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/silica
ADDED
data/lib/silica.rb
ADDED
data/lib/silica/cli.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'git'
|
4
|
+
|
5
|
+
module Silica
|
6
|
+
class Cli < Thor
|
7
|
+
desc 'new', 'create new project'
|
8
|
+
|
9
|
+
def new(name)
|
10
|
+
puts "Create new project '#{name}'"
|
11
|
+
|
12
|
+
FileUtils.mkdir name
|
13
|
+
dir = Dir.new(__dir__+'/../../template/project')
|
14
|
+
dir.each do |file|
|
15
|
+
FileUtils.cp_r(dir.path + '/' + file, name)
|
16
|
+
end
|
17
|
+
|
18
|
+
FileUtils.cd name
|
19
|
+
|
20
|
+
Git.init
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
File without changes
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
Bundler.require(:default)
|
3
|
+
|
4
|
+
require 'menilite'
|
5
|
+
|
6
|
+
require_relative 'server'
|
7
|
+
|
8
|
+
app = Rack::Builder.app do
|
9
|
+
server = Server.new(host: 'localhost')
|
10
|
+
|
11
|
+
map '/' do
|
12
|
+
run server
|
13
|
+
end
|
14
|
+
|
15
|
+
map '/assets' do
|
16
|
+
run Server::OPAL.sprockets
|
17
|
+
end
|
18
|
+
|
19
|
+
map '/__OPAL_SOURCE_MAPS__' do
|
20
|
+
run Opal::SourceMapServer.new(Server::OPAL.sprockets, '/__OPAL_SOURCE_MAPS__')
|
21
|
+
end
|
22
|
+
|
23
|
+
map '/api' do
|
24
|
+
router = Menilite::Router.new
|
25
|
+
run router.routes(server.settings)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
Rack::Server.start({
|
30
|
+
app: app,
|
31
|
+
server: 'thin',
|
32
|
+
Host: '0.0.0.0',
|
33
|
+
Port: 9292,
|
34
|
+
signals: false,
|
35
|
+
})
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'sinatra'
|
2
|
+
require 'opal'
|
3
|
+
require 'opal/sprockets'
|
4
|
+
require 'sinatra/activerecord'
|
5
|
+
|
6
|
+
if development?
|
7
|
+
require 'sinatra/reloader'
|
8
|
+
end
|
9
|
+
|
10
|
+
class Server < Sinatra::Base
|
11
|
+
OPAL = Opal::Server.new do |server|
|
12
|
+
server.append_path 'app'
|
13
|
+
server.append_path 'assets'
|
14
|
+
Opal.use_gem 'hyalite'
|
15
|
+
Opal.use_gem 'menilite'
|
16
|
+
Opal.paths.each {|path| server.append_path path }
|
17
|
+
|
18
|
+
server.main = 'application'
|
19
|
+
end
|
20
|
+
|
21
|
+
configure do
|
22
|
+
set opal: OPAL
|
23
|
+
enable :sessions
|
24
|
+
end
|
25
|
+
|
26
|
+
get '/' do
|
27
|
+
haml :index
|
28
|
+
end
|
29
|
+
|
30
|
+
get "/favicon.ico" do
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
!!!
|
2
|
+
%html(lang="en" data-framework="hyalite")
|
3
|
+
%head
|
4
|
+
%link{rel:"stylesheet", href:"assets/css/application.css"}
|
5
|
+
%body
|
6
|
+
.content
|
7
|
+
|
8
|
+
= ::Opal::Sprockets.javascript_include_tag('application', sprockets: settings.opal.sprockets, prefix: 'assets', debug: true)
|
9
|
+
|
metadata
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: silica
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- youchan
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-08-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
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: git
|
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: '1.12'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.12'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.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: '3.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
description: Web application framework spcialized for the single page applications
|
84
|
+
using Opalrb.
|
85
|
+
email:
|
86
|
+
- youchan01@gmail.com
|
87
|
+
executables:
|
88
|
+
- silica
|
89
|
+
extensions: []
|
90
|
+
extra_rdoc_files: []
|
91
|
+
files:
|
92
|
+
- bin/console
|
93
|
+
- bin/setup
|
94
|
+
- bin/silica
|
95
|
+
- lib/silica.rb
|
96
|
+
- lib/silica/cli.rb
|
97
|
+
- lib/silica/version.rb
|
98
|
+
- template/project/Gemfile
|
99
|
+
- template/project/Rakefile
|
100
|
+
- template/project/app/application.rb
|
101
|
+
- template/project/assets/css/application.scss
|
102
|
+
- template/project/config.ru
|
103
|
+
- template/project/server.rb
|
104
|
+
- template/project/views/index.haml
|
105
|
+
homepage: https://github.com/youchan/silica
|
106
|
+
licenses: []
|
107
|
+
metadata: {}
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options: []
|
110
|
+
require_paths:
|
111
|
+
- lib
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
requirements: []
|
123
|
+
rubyforge_project:
|
124
|
+
rubygems_version: 2.5.1
|
125
|
+
signing_key:
|
126
|
+
specification_version: 4
|
127
|
+
summary: Web application framework spcialized for the single page applications using
|
128
|
+
Opalrb.
|
129
|
+
test_files: []
|