gast 0.0.1
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 +7 -0
- data/.gitignore +23 -0
- data/.rspec +4 -0
- data/Gemfile +14 -0
- data/Guardfile +22 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +2 -0
- data/bin/gast +3 -0
- data/config.ru +11 -0
- data/gast.gemspec +38 -0
- data/lib/gast/app.rb +79 -0
- data/lib/gast/assets/stylesheets/application.sass +0 -0
- data/lib/gast/memo.rb +43 -0
- data/lib/gast/repository.rb +56 -0
- data/lib/gast/templates/edit.haml +5 -0
- data/lib/gast/templates/error.haml +2 -0
- data/lib/gast/templates/form.haml +7 -0
- data/lib/gast/templates/form_area.haml +8 -0
- data/lib/gast/templates/header.haml +8 -0
- data/lib/gast/templates/index.haml +4 -0
- data/lib/gast/templates/layout.haml +8 -0
- data/lib/gast/templates/list.haml +7 -0
- data/lib/gast/templates/navbar.haml +11 -0
- data/lib/gast/templates/save.haml +4 -0
- data/lib/gast/templates/view.haml +7 -0
- data/lib/gast/version.rb +3 -0
- data/lib/gast.rb +6 -0
- data/spec/controller_spec.rb +84 -0
- data/spec/memo_spec.rb +26 -0
- data/spec/repository_spec.rb +39 -0
- data/spec/spec_helper.rb +40 -0
- metadata +304 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7137e787b00e633d33b82e86e81521ac9d74d184
|
4
|
+
data.tar.gz: f46f99a0614c4a5f37a5bcbde3cd7586babdfe3e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c4f0669303fb5278c7947d888b443bec0a52a513a86e19171e5c4f11e076e4fa6d22a20a8eb42b0984deb75c359c5207213fb4e0ca18d1908cd4d5a488946e71
|
7
|
+
data.tar.gz: e278d5c37a085b5702c6aad84d16420b78374c3be3d14a947d457d15f39affc12888ec2038985bfa8271ebd90540da03ace082003240db6986054398af849c64
|
data/.gitignore
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
23
|
+
vendor/*
|
data/.rspec
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard :spork, :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
|
5
|
+
watch('lib/gast.rb')
|
6
|
+
watch('lib/gast/app.rb')
|
7
|
+
watch('lib/gast/memo.rb.rb')
|
8
|
+
watch('lib/gast/version.rb')
|
9
|
+
watch('Gemfile.lock')
|
10
|
+
watch('spec/spec_helper.rb') { :rspec }
|
11
|
+
watch('test/test_helper.rb') { :test_unit }
|
12
|
+
watch(%r{features/support/}) { :cucumber }
|
13
|
+
end
|
14
|
+
|
15
|
+
guard :rspec, cmd: 'bundle ex rspec' do
|
16
|
+
watch(%r{^spec/.+_spec\.rb$})
|
17
|
+
watch('spec/spec_helper.rb') { "spec" }
|
18
|
+
|
19
|
+
watch(%r{^lib/gast/app.rb$}) { |m| "spec/controller_spec.rb" }
|
20
|
+
watch(%r{^lib/gast/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
21
|
+
end
|
22
|
+
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 futoase
|
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,29 @@
|
|
1
|
+
# Gast
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'gast'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install gast
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it ( https://github.com/[my-github-username]/gast/fork )
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/gast
ADDED
data/config.ru
ADDED
data/gast.gemspec
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'gast/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "gast"
|
8
|
+
spec.version = Gast::VERSION
|
9
|
+
spec.authors = ["futoase"]
|
10
|
+
spec.email = ["futoase@gmail.com"]
|
11
|
+
spec.summary = %q{memo application of using git}
|
12
|
+
spec.description = %q{memo application of using git}
|
13
|
+
spec.homepage = ""
|
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_dependency "bundler", "~> 1.6"
|
22
|
+
spec.add_dependency "rake"
|
23
|
+
spec.add_dependency "sinatra"
|
24
|
+
spec.add_dependency "sinatra-contrib"
|
25
|
+
spec.add_dependency "puma"
|
26
|
+
spec.add_dependency "sequel"
|
27
|
+
spec.add_dependency "haml"
|
28
|
+
spec.add_dependency "sass"
|
29
|
+
spec.add_dependency "git"
|
30
|
+
spec.add_dependency "sprockets"
|
31
|
+
spec.add_dependency "sprockets-helpers"
|
32
|
+
|
33
|
+
spec.add_development_dependency "webmock"
|
34
|
+
spec.add_development_dependency "rspec"
|
35
|
+
spec.add_development_dependency "rack-test"
|
36
|
+
spec.add_development_dependency "pry"
|
37
|
+
spec.add_development_dependency "pry-remote"
|
38
|
+
end
|
data/lib/gast/app.rb
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'sinatra/base'
|
2
|
+
require 'sinatra/reloader'
|
3
|
+
require 'sprockets'
|
4
|
+
require 'sprockets-helpers'
|
5
|
+
require 'gast/memo'
|
6
|
+
require 'gast'
|
7
|
+
|
8
|
+
module Gast
|
9
|
+
class App < Sinatra::Base
|
10
|
+
|
11
|
+
enable :method_override
|
12
|
+
set :sprockets, Sprockets::Environment.new(root)
|
13
|
+
set :assets_prefix, '/assets'
|
14
|
+
set :digest_assets, false
|
15
|
+
set :views, settings.root + '/templates'
|
16
|
+
|
17
|
+
configure do
|
18
|
+
sprockets.append_path File.join(root, 'assets', 'stylesheets')
|
19
|
+
sprockets.append_path File.join(root, 'assets', 'javascripts')
|
20
|
+
sprockets.append_path File.join(root, 'assets', 'images')
|
21
|
+
|
22
|
+
Sprockets::Helpers.configure do |config|
|
23
|
+
config.environment = sprockets
|
24
|
+
config.prefix = assets_prefix
|
25
|
+
config.digest = digest_assets
|
26
|
+
#config.public_path = public_folder
|
27
|
+
|
28
|
+
config.debug = true
|
29
|
+
end
|
30
|
+
|
31
|
+
register Sinatra::Reloader
|
32
|
+
end
|
33
|
+
|
34
|
+
helpers do
|
35
|
+
include Sprockets::Helpers
|
36
|
+
end
|
37
|
+
|
38
|
+
before %r{/posts/\w+/(\w+)} do |id|
|
39
|
+
unless /[a-zA-Z0-9]{30}/ =~ id.to_s
|
40
|
+
halt haml(:error, locals: { message: "error is format of id" })
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
get '/' do
|
45
|
+
haml :index, locals: { new_post: true }
|
46
|
+
end
|
47
|
+
|
48
|
+
get '/posts/list' do
|
49
|
+
@lists = Gast::Memo.lists
|
50
|
+
haml :list
|
51
|
+
end
|
52
|
+
|
53
|
+
get '/posts/view/:id' do
|
54
|
+
@item = Gast::Memo.item(params[:id].to_s)
|
55
|
+
@content_hash = params[:id].to_s
|
56
|
+
haml :view
|
57
|
+
end
|
58
|
+
|
59
|
+
get '/posts/edit/:id' do
|
60
|
+
@item = Gast::Memo.item(params[:id].to_s)
|
61
|
+
@content_hash = params[:id].to_s
|
62
|
+
haml :edit
|
63
|
+
end
|
64
|
+
|
65
|
+
put '/posts/update/:id' do
|
66
|
+
@result = Gast::Memo.update(
|
67
|
+
id=params[:id].to_s,
|
68
|
+
content=params[:content].to_s
|
69
|
+
)
|
70
|
+
redirect to("/posts/view/#{params[:id]}")
|
71
|
+
end
|
72
|
+
|
73
|
+
post '/posts/new' do
|
74
|
+
new_id = Gast::Memo.save(params[:content].to_s)
|
75
|
+
redirect to("/posts/view/#{new_id}")
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
end
|
File without changes
|
data/lib/gast/memo.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'git'
|
2
|
+
require 'date'
|
3
|
+
require 'digest/sha2'
|
4
|
+
require 'gast/repository'
|
5
|
+
|
6
|
+
module Gast
|
7
|
+
|
8
|
+
class Memo
|
9
|
+
|
10
|
+
def self.save(content)
|
11
|
+
@repo = Gast::Repository.new
|
12
|
+
@repo.content = content.to_s
|
13
|
+
@repo.publish
|
14
|
+
@repo.commit!
|
15
|
+
@repo.dir_name
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.update(id, content)
|
19
|
+
@repo = Gast::Repository.new(id)
|
20
|
+
@repo.content = content.to_s
|
21
|
+
@repo.publish
|
22
|
+
@repo.commit!
|
23
|
+
@repo.dir_name
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.number
|
27
|
+
lists.length
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.lists
|
31
|
+
Dir.glob(File.expand_path(Gast::PATH + '/**')).map do |dir|
|
32
|
+
dir.split('/').last
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.item(id)
|
37
|
+
File.read(File.expand_path(Gast::PATH + "/#{id}/content"))
|
38
|
+
end
|
39
|
+
|
40
|
+
def initialize; end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'digest/sha2'
|
2
|
+
|
3
|
+
module Gast
|
4
|
+
class Repository
|
5
|
+
|
6
|
+
attr_reader :path, :dir_name
|
7
|
+
|
8
|
+
def initialize(dir_name=nil)
|
9
|
+
if dir_name.nil?
|
10
|
+
@dir_name = Digest::SHA512.new.update(rand.to_s).to_s[0..30]
|
11
|
+
else
|
12
|
+
@dir_name = dir_name.to_s
|
13
|
+
end
|
14
|
+
|
15
|
+
@path = File.expand_path(File.join(Gast::PATH, @dir_name))
|
16
|
+
|
17
|
+
create_dir
|
18
|
+
|
19
|
+
@git = Git.init(@path)
|
20
|
+
end
|
21
|
+
|
22
|
+
def content=(content)
|
23
|
+
@content = content
|
24
|
+
end
|
25
|
+
|
26
|
+
def publish
|
27
|
+
@save_path = File.expand_path(@path + '/content')
|
28
|
+
open(@save_path, 'w', 0644) { |io| io.write(@content) }
|
29
|
+
end
|
30
|
+
|
31
|
+
def remove!
|
32
|
+
FileUtils.remove_entry_secure(@path)
|
33
|
+
end
|
34
|
+
|
35
|
+
def save!
|
36
|
+
@git.add(all: true)
|
37
|
+
@git.commit_all("commit: #{DateTime.now.to_s}")
|
38
|
+
end
|
39
|
+
|
40
|
+
def commit!
|
41
|
+
return save! if @git.ls_files.length == 0
|
42
|
+
return save! if @git.status.changed.length != 0
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def create_dir
|
48
|
+
unless File.exists?(@path)
|
49
|
+
FileUtils.mkdir_p(@path)
|
50
|
+
FileUtils.chmod(0755, @path)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
%meta{ charset: "utf-8" }
|
2
|
+
%title
|
3
|
+
Gast
|
4
|
+
%link{:href=>"//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css", :rel=>"stylesheet"}
|
5
|
+
%script{:src=>"//code.jquery.com/jquery-2.1.0.min.js"}
|
6
|
+
%script{:src=>"//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"}
|
7
|
+
%link{ rel: 'stylesheet', href: stylesheet_path('application') }
|
8
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
%nav
|
2
|
+
.navbar.navbar-default{ role: "navigation" }
|
3
|
+
.container-fluid
|
4
|
+
.navbar-header
|
5
|
+
%a{ class: "navbar-brand", href: "#{url('/')}" }
|
6
|
+
Gast
|
7
|
+
%div{ class: "collapse navbar-collapse" }
|
8
|
+
%ul{ class: "nav navbar-nav" }
|
9
|
+
%li
|
10
|
+
%a{ href: "#{url('/posts/list')}" }
|
11
|
+
list
|
data/lib/gast/version.rb
ADDED
data/lib/gast.rb
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
def app
|
4
|
+
Gast::App
|
5
|
+
end
|
6
|
+
|
7
|
+
describe Gast::App do
|
8
|
+
|
9
|
+
let(:repo_dir) { File.expand_path("/tmp/gast") }
|
10
|
+
|
11
|
+
after(:each) do
|
12
|
+
FileUtils.rm_r(Dir.glob(repo_dir + '/**'), secure: true)
|
13
|
+
end
|
14
|
+
|
15
|
+
let(:hello_world) { "Hello World" }
|
16
|
+
let(:welcome_to_underground) { "Welcome to underground" }
|
17
|
+
let(:view_path) { /.+\/posts\/view\/[a-z0-9]+/ }
|
18
|
+
|
19
|
+
it "should be get index" do
|
20
|
+
get '/'
|
21
|
+
expect(last_response).to be_ok
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should be get title of index" do
|
25
|
+
get '/'
|
26
|
+
expect(last_response.body).to match(/Gast/)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should be get error" do
|
30
|
+
get '/hogehoge'
|
31
|
+
expect(last_response).not_to be_ok
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should be get list" do
|
35
|
+
get '/posts/list'
|
36
|
+
expect(last_response).to be_ok
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should be save of content on git directory" do
|
40
|
+
post '/posts/new', { content: hello_world }
|
41
|
+
expect(last_response.status).to eq 302
|
42
|
+
expect(last_response.location).to match(view_path)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should be update content" do
|
46
|
+
post '/posts/new', { content: hello_world }
|
47
|
+
|
48
|
+
expect(last_response.status).to eq 302
|
49
|
+
expect(last_response.location).to match(view_path)
|
50
|
+
|
51
|
+
post '/posts/new', { content: welcome_to_underground }
|
52
|
+
expect(last_response.status).to eq 302
|
53
|
+
expect(last_response.location).to match(view_path)
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should be view of item" do
|
57
|
+
post '/posts/new', { content: hello_world }
|
58
|
+
|
59
|
+
repository = File.expand_path(Dir.glob(repo_dir + '/**').first)
|
60
|
+
|
61
|
+
get "/posts/view/#{repository.split('/').last}"
|
62
|
+
|
63
|
+
expect(last_response).to be_ok
|
64
|
+
expect(File.read(repository + '/content')).to eq hello_world
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should be can update of item" do
|
68
|
+
post '/posts/new', { content: hello_world }
|
69
|
+
|
70
|
+
repository = File.expand_path(Dir.glob(repo_dir + '/**').first)
|
71
|
+
|
72
|
+
get "/posts/view/#{repository.split('/').last}"
|
73
|
+
|
74
|
+
expect(last_response).to be_ok
|
75
|
+
|
76
|
+
put "/posts/update/#{repository.split('/').last}", { content: welcome_to_underground }
|
77
|
+
get "/posts/view/#{repository.split('/').last}"
|
78
|
+
|
79
|
+
expect(last_response).to be_ok
|
80
|
+
|
81
|
+
expect(File.read(repository + '/content')).to eq welcome_to_underground
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
data/spec/memo_spec.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Gast::Memo do
|
4
|
+
|
5
|
+
def repo_path(num)
|
6
|
+
File.expand_path("/tmp/gast/#{num}")
|
7
|
+
end
|
8
|
+
|
9
|
+
def repo_dir
|
10
|
+
'/tmp/gast'
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:welcome_to_underground) { "Welcome to underground" }
|
14
|
+
|
15
|
+
after(:each) {
|
16
|
+
FileUtils.rm_r(Dir.glob(repo_dir + '/**'), secure: true)
|
17
|
+
}
|
18
|
+
|
19
|
+
it "should be get list of directory" do
|
20
|
+
0.upto(9) do |i|
|
21
|
+
Gast::Memo.save(welcome_to_underground)
|
22
|
+
end
|
23
|
+
expect(Gast::Memo.number).to eq 10
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Gast::Repository do
|
4
|
+
|
5
|
+
let(:repo) { Gast::Repository.new }
|
6
|
+
|
7
|
+
let(:git) { Git.init(repo.path) }
|
8
|
+
|
9
|
+
let(:repo_path) { File.expand_path("/tmp/gast/1") }
|
10
|
+
|
11
|
+
let(:repo_dir) { "/tmp/gast" }
|
12
|
+
|
13
|
+
let(:user_content) { "Hello World" }
|
14
|
+
|
15
|
+
before(:each) {
|
16
|
+
repo.content = user_content
|
17
|
+
repo.publish
|
18
|
+
repo.commit!
|
19
|
+
}
|
20
|
+
|
21
|
+
after(:each) {
|
22
|
+
FileUtils.rm_r(Dir.glob(repo_dir + '/**'), secure: true)
|
23
|
+
}
|
24
|
+
|
25
|
+
it "should be create of repository" do
|
26
|
+
expect(FileTest.exists?(repo.path)).to be_true
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should be content is a Hello world" do
|
30
|
+
expect(File.read(repo.path + '/content')).to eq user_content
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should be save of commit message is correct" do
|
34
|
+
Timecop.freeze
|
35
|
+
expect(git.log.first.message).to eq "commit: #{DateTime.now.to_s}"
|
36
|
+
Timecop.return
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'spork'
|
3
|
+
#uncomment the following line to use spork with the debugger
|
4
|
+
#require 'spork/ext/ruby-debug'
|
5
|
+
|
6
|
+
Spork.prefork do
|
7
|
+
# Loading more in this block will cause your tests to run faster. However,
|
8
|
+
# if you change any configuration or code from libraries loaded here, you'll
|
9
|
+
# need to restart spork for it take effect.
|
10
|
+
end
|
11
|
+
|
12
|
+
Spork.each_run do
|
13
|
+
# This code will be run each time you run your specs.
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
$:.unshift File.realpath(File.dirname(__FILE__) + '/../lib')
|
18
|
+
require 'rspec'
|
19
|
+
require 'rack/test'
|
20
|
+
require 'webmock/rspec'
|
21
|
+
|
22
|
+
require 'sinatra'
|
23
|
+
require 'timecop'
|
24
|
+
|
25
|
+
disable :show_exceptions
|
26
|
+
disable :raise_errors
|
27
|
+
|
28
|
+
require 'gast/app'
|
29
|
+
require 'gast/memo'
|
30
|
+
require 'gast/repository'
|
31
|
+
|
32
|
+
include Rack::Test::Methods
|
33
|
+
|
34
|
+
RSpec.configure do |config|
|
35
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
36
|
+
config.run_all_when_everything_filtered = true
|
37
|
+
config.filter_run :focus
|
38
|
+
|
39
|
+
config.order = 'random'
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,304 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gast
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- futoase
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-05-18 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.6'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
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: sinatra
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
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: sinatra-contrib
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
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: puma
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: sequel
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: haml
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: sass
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: git
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: sprockets
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: sprockets-helpers
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: webmock
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: rspec
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: rack-test
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: pry
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: pry-remote
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
237
|
+
description: memo application of using git
|
238
|
+
email:
|
239
|
+
- futoase@gmail.com
|
240
|
+
executables:
|
241
|
+
- gast
|
242
|
+
extensions: []
|
243
|
+
extra_rdoc_files: []
|
244
|
+
files:
|
245
|
+
- ".gitignore"
|
246
|
+
- ".rspec"
|
247
|
+
- Gemfile
|
248
|
+
- Guardfile
|
249
|
+
- LICENSE.txt
|
250
|
+
- README.md
|
251
|
+
- Rakefile
|
252
|
+
- bin/gast
|
253
|
+
- config.ru
|
254
|
+
- gast.gemspec
|
255
|
+
- lib/gast.rb
|
256
|
+
- lib/gast/app.rb
|
257
|
+
- lib/gast/assets/stylesheets/application.sass
|
258
|
+
- lib/gast/memo.rb
|
259
|
+
- lib/gast/repository.rb
|
260
|
+
- lib/gast/templates/edit.haml
|
261
|
+
- lib/gast/templates/error.haml
|
262
|
+
- lib/gast/templates/form.haml
|
263
|
+
- lib/gast/templates/form_area.haml
|
264
|
+
- lib/gast/templates/header.haml
|
265
|
+
- lib/gast/templates/index.haml
|
266
|
+
- lib/gast/templates/layout.haml
|
267
|
+
- lib/gast/templates/list.haml
|
268
|
+
- lib/gast/templates/navbar.haml
|
269
|
+
- lib/gast/templates/save.haml
|
270
|
+
- lib/gast/templates/view.haml
|
271
|
+
- lib/gast/version.rb
|
272
|
+
- spec/controller_spec.rb
|
273
|
+
- spec/memo_spec.rb
|
274
|
+
- spec/repository_spec.rb
|
275
|
+
- spec/spec_helper.rb
|
276
|
+
homepage: ''
|
277
|
+
licenses:
|
278
|
+
- MIT
|
279
|
+
metadata: {}
|
280
|
+
post_install_message:
|
281
|
+
rdoc_options: []
|
282
|
+
require_paths:
|
283
|
+
- lib
|
284
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
285
|
+
requirements:
|
286
|
+
- - ">="
|
287
|
+
- !ruby/object:Gem::Version
|
288
|
+
version: '0'
|
289
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
290
|
+
requirements:
|
291
|
+
- - ">="
|
292
|
+
- !ruby/object:Gem::Version
|
293
|
+
version: '0'
|
294
|
+
requirements: []
|
295
|
+
rubyforge_project:
|
296
|
+
rubygems_version: 2.2.2
|
297
|
+
signing_key:
|
298
|
+
specification_version: 4
|
299
|
+
summary: memo application of using git
|
300
|
+
test_files:
|
301
|
+
- spec/controller_spec.rb
|
302
|
+
- spec/memo_spec.rb
|
303
|
+
- spec/repository_spec.rb
|
304
|
+
- spec/spec_helper.rb
|