agile-proxy 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 486771186dc4f25cc188f5c42084e9b33f6cd578
4
- data.tar.gz: f534aaae143f5e45e3183a5c2be216c810d63ae9
3
+ metadata.gz: b65104dbcdc2bd0d60f917976c800399926d9468
4
+ data.tar.gz: 8052c786aee60f6f2538cae39496e756d8d3e624
5
5
  SHA512:
6
- metadata.gz: f04fbc07f8a9e55828d1e934a3e1aa56e78ae6910806dcd5c07a08a2dc38feaab89470f1025cc43a045d37dad01f9ea2338d9dae934a426ae893f2fe9172cce8
7
- data.tar.gz: 728ea2607acdc245de7ba075cefe6972e83399b551af7b033e7bf7f25dd1ed6fbbb2ec5218264c031cac5ecdc38bb7c5acf58e4df72fe83d6d094fa9315ac540
6
+ metadata.gz: 328d529f559d661538824d790d15ab9519d6085471e0a931d593aa786ab4f2fe4567ebf9e15b6df3f207453473aa0ad79280686c631793792c814579736be1a3
7
+ data.tar.gz: 1467d0f528154b9eb106c05a9e639dc841a13ff734496f4f938a360af65ac7c8ab534905b608a16b317a220133e44043c9191145403991cf369bcae226d656a6
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- agile-proxy (0.1.3)
4
+ agile-proxy (0.1.5)
5
5
  activerecord (~> 4.1.6)
6
6
  em-http-request (~> 1.1.2)
7
7
  em-synchrony (~> 1.0.3)
@@ -219,10 +219,10 @@ GEM
219
219
  simplecov-html (0.8.0)
220
220
  slop (3.6.0)
221
221
  sqlite3 (1.3.10)
222
- thin (1.6.2)
223
- daemons (>= 1.0.9)
224
- eventmachine (>= 1.0.0)
225
- rack (>= 1.0.0)
222
+ thin (1.6.3)
223
+ daemons (~> 1.0, >= 1.0.9)
224
+ eventmachine (~> 1.0)
225
+ rack (~> 1.0)
226
226
  thor (0.19.1)
227
227
  thread_safe (0.3.4)
228
228
  tilt (2.0.1)
data/Rakefile CHANGED
@@ -1,11 +1,13 @@
1
1
  #!/usr/bin/env rake
2
2
  require 'bundler/gem_tasks'
3
3
  require 'active_record'
4
+ require_relative 'db/seed'
4
5
  include ActiveRecord::Tasks
5
6
  DatabaseTasks.database_configuration = YAML.load_file('config.yml')
6
7
  DatabaseTasks.db_dir = 'db'
7
8
  DatabaseTasks.migrations_paths = 'db/migrations'
8
9
  DatabaseTasks.env = ENV['ENV'] || 'development'
10
+ DatabaseTasks.seed_loader = AgileProxy::Seed
9
11
  ActiveRecord::Base.establish_connection(DatabaseTasks.database_configuration[DatabaseTasks.env])
10
12
  DatabaseTasks.root = File.dirname(__FILE__)
11
13
  Rake::Task.define_task(:environment)
@@ -3,6 +3,7 @@ require 'agile_proxy'
3
3
  require 'thor'
4
4
  require 'rake'
5
5
  require 'active_record'
6
+ require_relative '../db/seed'
6
7
  module AgileProxy
7
8
  include ActiveRecord::Tasks
8
9
  class Cli < Thor
@@ -55,7 +56,7 @@ module AgileProxy
55
56
 
56
57
  def setup_for_migrations(options)
57
58
  ActiveRecord::Tasks::DatabaseTasks.db_dir = options.data_dir
58
- ActiveRecord::Tasks::DatabaseTasks.migrations_paths = [File.expand_path('../db/migrate', File.dirname(__FILE__))]
59
+ ActiveRecord::Tasks::DatabaseTasks.migrations_paths = [File.expand_path('../db/migrations', File.dirname(__FILE__))]
59
60
  ActiveRecord::Tasks::DatabaseTasks.env = options.env
60
61
  ActiveRecord::Tasks::DatabaseTasks.root = File.expand_path('..', __FILE__)
61
62
  ActiveRecord::Migrator.migrations_paths = ActiveRecord::Tasks::DatabaseTasks.migrations_paths
@@ -65,7 +66,10 @@ module AgileProxy
65
66
  ActiveRecord::Migrator.migrate(ActiveRecord::Migrator.migrations_paths, nil) do |migration|
66
67
  ENV["SCOPE"].blank? || (ENV["SCOPE"] == migration.scope)
67
68
  end
69
+ end
68
70
 
71
+ def seed_database
72
+ Seed.load_seed
69
73
  end
70
74
 
71
75
  def server
@@ -75,6 +79,7 @@ module AgileProxy
75
79
  def update_db
76
80
  ActiveRecord::Tasks::DatabaseTasks.create_current
77
81
  run_migrations
82
+ seed_database
78
83
  # Rake::Task['db:create'].invoke
79
84
  # Rake::Task['db:migrate'].invoke
80
85
 
data/db.yml CHANGED
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  :development:
3
3
  :adapter: sqlite3
4
- :database: "/home/gary/projects/ruby/http-flexible-proxy/db/development.db"
4
+ :database: "db/development.db"
5
5
  :test:
6
6
  :adapter: sqlite3
7
- :database: "/home/gary/projects/ruby/http-flexible-proxy/db/test.db"
7
+ :database: "db/test.db"
8
8
  :production:
9
9
  :adapter: sqlite3
10
- :database: "/home/gary/projects/ruby/http-flexible-proxy/db/production.db"
10
+ :database: "db/production.db"
@@ -0,0 +1,26 @@
1
+ require 'agile_proxy/model/user'
2
+ require 'agile_proxy/model/application'
3
+ module AgileProxy
4
+ class Seed
5
+ class << self
6
+ def load_seed
7
+ create_default_user
8
+ create_default_application
9
+ end
10
+
11
+ private
12
+
13
+ def create_default_user
14
+ User.create name: 'public', email: 'public@agileproxy.com', id: 1 if (User.where(name: 'public').count == 0)
15
+ end
16
+
17
+ def create_default_application
18
+ Application.create user_id: public_user.id, name: 'Default Application', username: 'public-app-1', password: 'password', id: 1 if (Application.where(name: 'Default Application').count == 0)
19
+ end
20
+
21
+ def public_user
22
+ User.where(name: 'public').first
23
+ end
24
+ end
25
+ end
26
+ end
@@ -2,5 +2,5 @@
2
2
  #
3
3
  # The Agile Proxy module is a common namespace for all classes / sub modules.
4
4
  module AgileProxy
5
- VERSION = '0.1.4'
5
+ VERSION = '0.1.5'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agile-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Taylor
@@ -480,7 +480,7 @@ files:
480
480
  - Rakefile
481
481
  - agile-proxy.gemspec
482
482
  - assets/index.html
483
- - assets/ui/app/HttpFlexibleProxyApi.js
483
+ - assets/ui/app/AgileProxyApi.js
484
484
  - assets/ui/app/app.js
485
485
  - assets/ui/app/controller/Stubs.js
486
486
  - assets/ui/app/controller/main.js
@@ -2123,6 +2123,7 @@ files:
2123
2123
  - db/migrations/20141119143800_add_record_to_applications.rb
2124
2124
  - db/migrations/20141119174300_create_recordings.rb
2125
2125
  - db/schema.rb
2126
+ - db/seed.rb
2126
2127
  - examples/README.md
2127
2128
  - examples/facebook_api.html
2128
2129
  - examples/tumblr_api.html