Commit 828a1ba3 by John Doe

set up infrastructure and added dbfolder

parent 4b7f0520
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
# Ignore bundler config. # Ignore bundler config.
/.bundle /.bundle
vendor/bundle
# Ignore the default SQLite database. # Ignore the default SQLite database.
/db/*.sqlite3 /db/*.sqlite3
......
--color --color
--require spec_helper --require spec_helper
--format documentation
\ No newline at end of file
...@@ -39,6 +39,14 @@ group :development, :test do ...@@ -39,6 +39,14 @@ group :development, :test do
gem 'rubocop', require: false gem 'rubocop', require: false
end end
group :development, :test do
gem 'guard'
gem 'guard-rspec'
gem 'spring-commands-rspec'
gem 'terminal-notifier-guard'
gem 'terminal-notifier'
end
group :development do group :development do
# Access an IRB console on exception pages or by using <%= console %> in views # Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0' gem 'web-console', '~> 2.0'
......
...@@ -42,6 +42,7 @@ GEM ...@@ -42,6 +42,7 @@ GEM
debug_inspector (>= 0.0.1) debug_inspector (>= 0.0.1)
builder (3.2.2) builder (3.2.2)
byebug (8.2.5) byebug (8.2.5)
coderay (1.1.1)
coffee-rails (4.1.1) coffee-rails (4.1.1)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x) railties (>= 4.0.0, < 5.1.x)
...@@ -54,8 +55,24 @@ GEM ...@@ -54,8 +55,24 @@ GEM
diff-lcs (1.2.5) diff-lcs (1.2.5)
erubis (2.7.0) erubis (2.7.0)
execjs (2.6.0) execjs (2.6.0)
ffi (1.9.10)
formatador (0.2.5)
globalid (0.3.6) globalid (0.3.6)
activesupport (>= 4.1.0) activesupport (>= 4.1.0)
guard (2.13.0)
formatador (>= 0.2.4)
listen (>= 2.7, <= 4.0)
lumberjack (~> 1.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-rspec (4.6.5)
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
i18n (0.7.0) i18n (0.7.0)
jbuilder (2.4.1) jbuilder (2.4.1)
activesupport (>= 3.0.0, < 5.1) activesupport (>= 3.0.0, < 5.1)
...@@ -65,21 +82,35 @@ GEM ...@@ -65,21 +82,35 @@ GEM
railties (>= 4.2.0) railties (>= 4.2.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
json (1.8.3) json (1.8.3)
listen (3.1.4)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.0.3) loofah (2.0.3)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
lumberjack (1.0.10)
mail (2.6.4) mail (2.6.4)
mime-types (>= 1.16, < 4) mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (3.0) mime-types (3.0)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2016.0221) mime-types-data (3.2016.0221)
mini_portile2 (2.0.0) mini_portile2 (2.0.0)
minitest (5.8.4) minitest (5.8.4)
multi_json (1.12.0) multi_json (1.12.0)
nenv (0.3.0)
nokogiri (1.6.7.2) nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2) mini_portile2 (~> 2.0.0.rc2)
notiffany (0.0.8)
nenv (~> 0.1)
shellany (~> 0.0)
parser (2.3.1.0) parser (2.3.1.0)
ast (~> 2.2) ast (~> 2.2)
powerpack (0.1.1) powerpack (0.1.1)
pry (0.10.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (1.6.4) rack (1.6.4)
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
...@@ -109,8 +140,15 @@ GEM ...@@ -109,8 +140,15 @@ GEM
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
rainbow (2.1.0) rainbow (2.1.0)
rake (11.1.2) rake (11.1.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
rdoc (4.2.2) rdoc (4.2.2)
json (~> 1.4) json (~> 1.4)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.4) rspec-core (3.4.4)
rspec-support (~> 3.4.0) rspec-support (~> 3.4.0)
rspec-expectations (3.4.0) rspec-expectations (3.4.0)
...@@ -135,6 +173,7 @@ GEM ...@@ -135,6 +173,7 @@ GEM
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1) unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.0) ruby-progressbar (1.8.0)
ruby_dep (1.3.1)
sass (3.4.22) sass (3.4.22)
sass-rails (5.0.4) sass-rails (5.0.4)
railties (>= 4.0.0, < 5.0) railties (>= 4.0.0, < 5.0)
...@@ -145,7 +184,11 @@ GEM ...@@ -145,7 +184,11 @@ GEM
sdoc (0.4.1) sdoc (0.4.1)
json (~> 1.7, >= 1.7.7) json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0) rdoc (~> 4.0)
shellany (0.0.1)
slop (3.6.0)
spring (1.7.1) spring (1.7.1)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (3.6.0) sprockets (3.6.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
rack (> 1, < 3) rack (> 1, < 3)
...@@ -154,6 +197,8 @@ GEM ...@@ -154,6 +197,8 @@ GEM
activesupport (>= 4.0) activesupport (>= 4.0)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
sqlite3 (1.3.11) sqlite3 (1.3.11)
terminal-notifier (1.6.3)
terminal-notifier-guard (1.7.0)
thor (0.19.1) thor (0.19.1)
thread_safe (0.3.5) thread_safe (0.3.5)
tilt (2.0.2) tilt (2.0.2)
...@@ -176,6 +221,8 @@ PLATFORMS ...@@ -176,6 +221,8 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
byebug byebug
coffee-rails (~> 4.1.0) coffee-rails (~> 4.1.0)
guard
guard-rspec
jbuilder (~> 2.0) jbuilder (~> 2.0)
jquery-rails jquery-rails
rails (= 4.2.6) rails (= 4.2.6)
...@@ -184,10 +231,13 @@ DEPENDENCIES ...@@ -184,10 +231,13 @@ DEPENDENCIES
sass-rails (~> 5.0) sass-rails (~> 5.0)
sdoc (~> 0.4.0) sdoc (~> 0.4.0)
spring spring
spring-commands-rspec
sqlite3 sqlite3
terminal-notifier
terminal-notifier-guard
turbolinks turbolinks
uglifier (>= 1.3.0) uglifier (>= 1.3.0)
web-console (~> 2.0) web-console (~> 2.0)
BUNDLED WITH BUNDLED WITH
1.12.2 1.12.3
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
## Uncomment and set this to only include directories you want to watch
# directories %w(app lib config test spec features) \
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
## Note: if you are using the `directories` clause above and you are not
## watching the project directory ('.'), then you will want to move
## the Guardfile to a watched dir and symlink it back, e.g.
#
# $ mkdir config
# $ mv Guardfile config/
# $ ln -s config/Guardfile .
#
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
# Note: The cmd option is now required due to the increasing number of ways
# rspec may be run, below are examples of the most common uses.
# * bundler: 'bundle exec rspec'
# * bundler binstubs: 'bin/rspec'
# * spring: 'bin/rspec' (This will use spring if running and you have
# installed the spring binstubs per the docs)
# * zeus: 'zeus rspec' (requires the server to be started separately)
# * 'just' rspec: 'rspec'
notification :terminal_notifier if `uname` =~ /Darwin/
guard :rspec, cmd: "bin/rspec" do
require "guard/rspec/dsl"
dsl = Guard::RSpec::Dsl.new(self)
# Feel free to open issues for suggestions and improvements
# RSpec files
rspec = dsl.rspec
watch(rspec.spec_helper) { rspec.spec_dir }
watch(rspec.spec_support) { rspec.spec_dir }
watch(rspec.spec_files)
# Ruby files
ruby = dsl.ruby
dsl.watch_spec_files_for(ruby.lib_files)
# Rails files
rails = dsl.rails(view_extensions: %w(erb haml slim))
dsl.watch_spec_files_for(rails.app_files)
dsl.watch_spec_files_for(rails.views)
watch(rails.controllers) do |m|
[
rspec.spec.("routing/#{m[1]}_routing"),
rspec.spec.("controllers/#{m[1]}_controller"),
rspec.spec.("acceptance/#{m[1]}")
]
end
# Rails config changes
watch(rails.spec_helper) { rspec.spec_dir }
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
# Capybara features specs
watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
watch(rails.layouts) { |m| rspec.spec.("features/#{m[1]}") }
# Turnip features and steps
watch(%r{^spec/acceptance/(.+)\.feature$})
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
end
end
class DbFoldersController < ApplicationController
end
# helper for DbFolder
module DbFoldersHelper
end
# a folder in the database, may contain one or more DbFiles as files
# and one or more DbFolders as subfolders
class DbFolder < ActiveRecord::Base
has_many :subfolders
has_many :files
end
#!/usr/bin/env ruby #!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
# frozen_string_literal: true # frozen_string_literal: true
# #
# This file was generated by Bundler. # This file was generated by Bundler.
......
#!/usr/bin/env ruby #!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
# frozen_string_literal: true # frozen_string_literal: true
# #
# This file was generated by Bundler. # This file was generated by Bundler.
......
#!/usr/bin/env ruby #!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
# frozen_string_literal: true # frozen_string_literal: true
# #
# This file was generated by Bundler. # This file was generated by Bundler.
......
#!/usr/bin/env ruby #!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'spring' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require "pathname" # This file loads spring without using Bundler, in order to be fast.
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", # It gets overwritten when you run the `spring binstub` command.
Pathname.new(__FILE__).realpath)
require "rubygems" unless defined?(Spring)
require "bundler/setup" require 'rubygems'
require 'bundler'
load Gem.bin_path("spring", "spring") if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m))
Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) }
gem 'spring', match[1]
require 'spring/binstub'
end
end
Rails.application.routes.draw do Rails.application.routes.draw do
resources :db_folders
# The priority is based upon order of creation: first created -> highest priority. # The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes". # See how all your routes lay out with "rake routes".
......
class CreateDbFolders < ActiveRecord::Migration
def change
create_table :db_folders do |t|
t.string :name
t.string :description
t.timestamps null: false
end
end
end
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160515193612) do
create_table "db_folders", force: :cascade do |t|
t.string "name"
t.string "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
end
require 'rails_helper'
RSpec.describe DbFoldersController, type: :controller do
end
require 'rails_helper'
RSpec.describe 'DbFolder' do
describe 'object' do
let(:db_folder) { DbFolder.new }
specify { expect(db_folder).to respond_to(:name) }
specify { expect(db_folder).to respond_to(:description) }
specify { expect(db_folder).to respond_to(:subfolders) }
specify { expect(db_folder).to respond_to(:files) }
end
end
require 'rails_helper'
RSpec.describe 'Folder' do
it 'has a name' do
folder = Folder.new(name: 'Test Folder')
expect(folder.name).to eq('Test Folder')
end
it 'may have a description'
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment