forked from mlpinit/bootleg
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
165 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Bootleg | ||
VERSION = "0.0.3" | ||
VERSION = "0.0.4" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'rails/generators/migration' | ||
|
||
module Bootleg | ||
module Generators | ||
class InstallGenerator < Rails::Generators::Base | ||
source_root File.expand_path('../templates', __FILE__) | ||
|
||
def run_generators | ||
generate "bootleg:movie" | ||
generate "bootleg:theater" | ||
generate "bootleg:showtime" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'rails/generators/migration' | ||
|
||
module Bootleg | ||
module Generators | ||
class MovieGenerator < Rails::Generators::Base | ||
include Rails::Generators::Migration | ||
|
||
source_root File.expand_path('../templates', __FILE__) | ||
|
||
def generate_movie_migration | ||
migration_template "movie_migration.rb", "db/migrate/create_bootleg_movies.rb" | ||
end | ||
|
||
def generate_movie_model | ||
copy_file "movie_model.rb", "app/models/bootleg_movie.rb" | ||
end | ||
|
||
def self.next_migration_number(path) | ||
@migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i.to_s | ||
end | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'rails/generators/migration' | ||
|
||
module Bootleg | ||
module Generators | ||
class ShowtimeGenerator < Rails::Generators::Base | ||
include Rails::Generators::Migration | ||
|
||
source_root File.expand_path('../templates', __FILE__) | ||
|
||
def generate_theater_movie_migration | ||
migration_template "showtime_migration.rb", "db/migrate/create_bootleg_showtimes.rb" | ||
end | ||
|
||
def generate_theater_movie_model | ||
copy_file "showtime_model.rb", "app/models/bootleg_showtime.rb" | ||
end | ||
|
||
def self.next_migration_number(path) | ||
@migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i.to_s | ||
end | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class CreateBootlegMovies < ActiveRecord::Migration | ||
def change | ||
create_table :bootleg_movies do |t| | ||
t.string :name | ||
t.string :href | ||
t.string :showtimes | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class BootlegMovie < ActiveRecord::Base | ||
attr_accessible :name, :href, :showtimes | ||
|
||
has_many :bootleg_showtimes | ||
has_many :theaters, through: :bootleg_showtimes, source: :bootleg_theater | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class CreateBootlegShowtimes < ActiveRecord::Migration | ||
def change | ||
create_table :bootleg_showtimes do |t| | ||
t.integer :bootleg_movie_id | ||
t.integer :bootleg_theater_id | ||
t.string :showtimes | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class BootlegShowtime < ActiveRecord::Base | ||
attr_accessible :bootleg_movie_id, :bootleg_theater_id, :showtimes | ||
|
||
belongs_to :bootleg_movie | ||
belongs_to :bootleg_theater | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class CreateBootlegTheaters < ActiveRecord::Migration | ||
def change | ||
create_table :bootleg_theaters do |t| | ||
t.string :name | ||
t.string :href | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class BootlegTheater < ActiveRecord::Base | ||
attr_accessible :name, :href | ||
|
||
has_many :bootleg_showtimes | ||
has_many :movies, through: :bootleg_showtimes, source: :bootleg_movie | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'rails/generators/migration' | ||
|
||
module Bootleg | ||
module Generators | ||
class TheaterGenerator < Rails::Generators::Base | ||
include Rails::Generators::Migration | ||
|
||
source_root File.expand_path('../templates', __FILE__) | ||
|
||
def generate_theater_migration | ||
migration_template "theater_migration.rb", "db/migrate/create_bootleg_theaters.rb" | ||
end | ||
|
||
def generate_theater_model | ||
copy_file "theater_model.rb", "app/models/bootleg_theater.rb" | ||
end | ||
|
||
def self.next_migration_number(path) | ||
@migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i.to_s | ||
end | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
require 'spec_helper' | ||
|
||
describe Presenter do | ||
it "should not work" do | ||
pending 'to be continued...' | ||
end | ||
end |