yhara-moneyrail 0.0.2

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.
Files changed (121) hide show
  1. data/.gitignore +5 -0
  2. data/.gitmodules +6 -0
  3. data/Changelog +21 -0
  4. data/README +1 -0
  5. data/Rakefile +32 -0
  6. data/VERSION +1 -0
  7. data/app/controllers/accounts_controller.rb +99 -0
  8. data/app/controllers/application_controller.rb +10 -0
  9. data/app/controllers/categories_controller.rb +99 -0
  10. data/app/controllers/home_controller.rb +31 -0
  11. data/app/controllers/items_controller.rb +105 -0
  12. data/app/controllers/logs_controller.rb +20 -0
  13. data/app/helpers/accounts_helper.rb +2 -0
  14. data/app/helpers/application_helper.rb +3 -0
  15. data/app/helpers/categories_helper.rb +2 -0
  16. data/app/helpers/home_helper.rb +2 -0
  17. data/app/helpers/items_helper.rb +2 -0
  18. data/app/helpers/logs_helper.rb +42 -0
  19. data/app/models/account.rb +12 -0
  20. data/app/models/category.rb +26 -0
  21. data/app/models/expense.rb +2 -0
  22. data/app/models/income.rb +2 -0
  23. data/app/models/item.rb +31 -0
  24. data/app/models/move.rb +37 -0
  25. data/app/models/simple_item.rb +27 -0
  26. data/app/views/accounts/edit.html.erb +16 -0
  27. data/app/views/accounts/index.html.erb +24 -0
  28. data/app/views/accounts/new.html.erb +15 -0
  29. data/app/views/accounts/show.html.erb +8 -0
  30. data/app/views/categories/edit.html.erb +20 -0
  31. data/app/views/categories/index.html.erb +26 -0
  32. data/app/views/categories/new.html.erb +19 -0
  33. data/app/views/categories/show.html.erb +13 -0
  34. data/app/views/home/index.html.erb +15 -0
  35. data/app/views/items/edit.html.erb +45 -0
  36. data/app/views/items/index.html.erb +38 -0
  37. data/app/views/items/new.html.erb +40 -0
  38. data/app/views/items/show.html.erb +3 -0
  39. data/app/views/layouts/application.html.erb +37 -0
  40. data/app/views/logs/view.html.erb +120 -0
  41. data/config/boot.rb +110 -0
  42. data/config/database.yml +25 -0
  43. data/config/environment.rb +41 -0
  44. data/config/environments/cucumber.rb +21 -0
  45. data/config/environments/development.rb +17 -0
  46. data/config/environments/production.rb +28 -0
  47. data/config/environments/test.rb +28 -0
  48. data/config/initializers/backtrace_silencers.rb +7 -0
  49. data/config/initializers/inflections.rb +10 -0
  50. data/config/initializers/mime_types.rb +5 -0
  51. data/config/initializers/new_rails_defaults.rb +19 -0
  52. data/config/initializers/session_store.rb +15 -0
  53. data/config/locales/en.yml +5 -0
  54. data/config/routes.rb +80 -0
  55. data/db/migrate/20090802070406_create_accounts.rb +14 -0
  56. data/db/migrate/20090802073601_create_categories.rb +15 -0
  57. data/db/migrate/20090804065900_create_items.rb +26 -0
  58. data/doc/README_FOR_APP +2 -0
  59. data/features/step_definitions/webrat_steps.rb +129 -0
  60. data/features/support/env.rb +37 -0
  61. data/features/support/paths.rb +27 -0
  62. data/lib/tasks/cucumber.rake +20 -0
  63. data/lib/tasks/rspec.rake +182 -0
  64. data/main.rb +5 -0
  65. data/moneyrail.gemspec +170 -0
  66. data/public/404.html +30 -0
  67. data/public/422.html +30 -0
  68. data/public/500.html +30 -0
  69. data/public/favicon.ico +0 -0
  70. data/public/images/rails.png +0 -0
  71. data/public/javascripts/application.js +2 -0
  72. data/public/javascripts/controls.js +963 -0
  73. data/public/javascripts/dragdrop.js +973 -0
  74. data/public/javascripts/editor.js +188 -0
  75. data/public/javascripts/effects.js +1128 -0
  76. data/public/javascripts/jquery-ui.js +160 -0
  77. data/public/javascripts/jquery.js +32 -0
  78. data/public/javascripts/prototype.js +4320 -0
  79. data/public/robots.txt +5 -0
  80. data/public/stylesheets/editor.less +67 -0
  81. data/script/about +4 -0
  82. data/script/autospec +6 -0
  83. data/script/console +3 -0
  84. data/script/cucumber +8 -0
  85. data/script/dbconsole +3 -0
  86. data/script/destroy +3 -0
  87. data/script/generate +3 -0
  88. data/script/performance/benchmarker +3 -0
  89. data/script/performance/profiler +3 -0
  90. data/script/plugin +3 -0
  91. data/script/runner +3 -0
  92. data/script/server +3 -0
  93. data/script/spec +10 -0
  94. data/script/spec_server +9 -0
  95. data/spec/_fixtures/accounts.yml +5 -0
  96. data/spec/_fixtures/categories.yml +19 -0
  97. data/spec/_fixtures/incomes.yml +7 -0
  98. data/spec/_fixtures/items.yml +7 -0
  99. data/spec/fixtures/accounts.yml +11 -0
  100. data/spec/fixtures/categories.yml +24 -0
  101. data/spec/fixtures/items.yml +82 -0
  102. data/spec/helpers/accounts_helper_spec.rb +11 -0
  103. data/spec/helpers/categories_helper_spec.rb +11 -0
  104. data/spec/helpers/items_helper_spec.rb +11 -0
  105. data/spec/models/account_spec.rb +13 -0
  106. data/spec/models/category_spec.rb +9 -0
  107. data/spec/models/income_spec.rb +9 -0
  108. data/spec/models/item_spec.rb +13 -0
  109. data/spec/rcov.opts +2 -0
  110. data/spec/spec.opts +4 -0
  111. data/spec/spec_helper.rb +51 -0
  112. data/vendor/plugins/acts_as_list/README +23 -0
  113. data/vendor/plugins/acts_as_list/init.rb +3 -0
  114. data/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +256 -0
  115. data/vendor/plugins/acts_as_list/test/list_test.rb +332 -0
  116. data/vendor/plugins/less/LICENCE +20 -0
  117. data/vendor/plugins/less/README +52 -0
  118. data/vendor/plugins/less/init.rb +19 -0
  119. data/vendor/plugins/less/lib/less_for_rails.rb +37 -0
  120. data/vendor/plugins/less/test/less_for_rails_test.rb +15 -0
  121. metadata +201 -0
data/public/robots.txt ADDED
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1,67 @@
1
+ @cell_width: 70px;
2
+
3
+ table.editor {
4
+ border-collapse: collapse;
5
+
6
+ * {
7
+ margin: 0px;
8
+ padding: 0px;
9
+ }
10
+
11
+ td, th {
12
+ border: 1px solid black;
13
+ }
14
+
15
+ // table head
16
+
17
+ th.inserts{
18
+ width: 1.5em;
19
+ }
20
+
21
+ th.date {
22
+ min-width: @cell_width;
23
+ width: @cell_width;
24
+ }
25
+
26
+ th.category {
27
+ min-width: @cell_width * 2;
28
+ width: @cell_width * 2;
29
+ }
30
+
31
+ // row
32
+
33
+ tr.even {
34
+ }
35
+ tr.odd, tr.odd input {
36
+ background: #f9f9ff;
37
+ }
38
+
39
+ // cell
40
+
41
+ td.title, td.amount {
42
+ min-width: @cell_width;
43
+ width: @cell_width;
44
+
45
+ input {
46
+ width: 90%;
47
+ border: none;
48
+ font-size: 100%;
49
+ padding-left: 3px;
50
+ }
51
+ }
52
+
53
+ td.title {
54
+ padding-left: 3px;
55
+ }
56
+
57
+ td.amount div, td.amount input {
58
+ text-align: right;
59
+ padding-right: 3px;
60
+ }
61
+ }
62
+
63
+ .pushable {
64
+ color: blue;
65
+ // text-decoration: underline;
66
+ cursor: pointer;
67
+ }
data/script/about ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ $LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
4
+ require 'commands/about'
data/script/autospec ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
3
+ ENV['RSPEC'] = 'true' # allows autotest to discover rspec
4
+ ENV['AUTOTEST'] = 'true' # allows autotest to run w/ color on linux
5
+ system((RUBY_PLATFORM =~ /mswin|mingw/ ? 'autotest.bat' : 'autotest'), *ARGV) ||
6
+ $stderr.puts("Unable to find autotest. Please install ZenTest or fix your PATH")
data/script/console ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/console'
data/script/cucumber ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path(File.dirname(__FILE__) + "/../vendor/plugins/cucumber/bin/cucumber")
4
+ rescue LoadError => e
5
+ raise unless e.to_s =~ /cucumber/
6
+ require "rubygems"
7
+ load File.join(Gem.bindir, "cucumber")
8
+ end
data/script/dbconsole ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/dbconsole'
data/script/destroy ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/destroy'
data/script/generate ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/generate'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/benchmarker'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/profiler'
data/script/plugin ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/plugin'
data/script/runner ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/runner'
data/script/server ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/server'
data/script/spec ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ if ARGV.any? {|arg| %w[--drb -X --generate-options -G --help -h --version -v].include?(arg)}
3
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
4
+ else
5
+ gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
6
+ ENV["RAILS_ENV"] ||= 'test'
7
+ require File.expand_path(File.dirname(__FILE__) + "/../config/environment") unless defined?(RAILS_ROOT)
8
+ end
9
+ require 'spec/autorun'
10
+ exit ::Spec::Runner::CommandLine.run
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
3
+
4
+ puts "Loading Rails environment"
5
+ ENV["RAILS_ENV"] ||= 'test'
6
+ require File.expand_path(File.dirname(__FILE__) + "/../config/environment") unless defined?(RAILS_ROOT)
7
+
8
+ require 'optparse'
9
+ require 'spec/rails/spec_server'
@@ -0,0 +1,5 @@
1
+ wallet:
2
+ name: Wallet
3
+
4
+ bank:
5
+ name: Bank
@@ -0,0 +1,19 @@
1
+ food_expense:
2
+ name: Food expense
3
+ kind: Expense
4
+
5
+ life_expense:
6
+ name: Life expense
7
+ kind: Expense
8
+
9
+ salary:
10
+ name: Sarary
11
+ kind: Income
12
+
13
+ special:
14
+ name: Special
15
+ kind: Income
16
+
17
+ withdraw:
18
+ name: Withdraw
19
+ kind: Move
@@ -0,0 +1,7 @@
1
+ august_sarary:
2
+ title: Sarary of August
3
+ account: bank
4
+ category: salary
5
+ amount: 1000
6
+ index_of_day: 0
7
+ date: 2009-08-25
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ # one:
4
+ # column: value
5
+ #
6
+ # two:
7
+ # column: value
@@ -0,0 +1,11 @@
1
+ wallet:
2
+ name: サイフ
3
+ position: 0
4
+
5
+ bank:
6
+ name: 銀行
7
+ position: 1
8
+
9
+ credit_card:
10
+ name: クレジットカード
11
+ position: 2
@@ -0,0 +1,24 @@
1
+ food_expense:
2
+ name: 食費
3
+ kind: Expense
4
+ position: 0
5
+
6
+ life_expense:
7
+ name: 生活費
8
+ kind: Expense
9
+ position: 1
10
+
11
+ salary:
12
+ name: 給料
13
+ kind: Income
14
+ position: 0
15
+
16
+ special:
17
+ name: 臨時収入
18
+ kind: Income
19
+ position: 1
20
+
21
+ withdraw:
22
+ name: 引き出し
23
+ kind: Move
24
+ position: 2
@@ -0,0 +1,82 @@
1
+ juice:
2
+ type: Expense
3
+ title: ジュース
4
+ account: wallet
5
+ category: food_expense
6
+ amount: 120
7
+ position: 0
8
+ date: 2009-08-01
9
+
10
+ juice7:
11
+ type: Expense
12
+ title: ジュース
13
+ account: wallet
14
+ category: food_expense
15
+ amount: 170
16
+ position: 0
17
+ date: 2009-07-01
18
+
19
+ juice9:
20
+ type: Expense
21
+ title: ジュース
22
+ account: wallet
23
+ category: food_expense
24
+ amount: 190
25
+ position: 0
26
+ date: 2009-09-01
27
+
28
+ dinner:
29
+ type: Expense
30
+ title: 夕飯
31
+ account: wallet
32
+ category: food_expense
33
+ amount: 1000
34
+ position: 1
35
+ date: 2009-08-01
36
+
37
+ dinner2:
38
+ type: Expense
39
+ title: 夕飯
40
+ account: wallet
41
+ category: food_expense
42
+ amount: 700
43
+ position: 0
44
+ date: 2009-08-02
45
+
46
+ dentist:
47
+ type: Expense
48
+ title: 歯医者
49
+ account: wallet
50
+ category: life_expense
51
+ amount: 1230
52
+ position: 0
53
+ date: 2009-08-01
54
+
55
+ august_sarary:
56
+ type: Income
57
+ title: 給料
58
+ account: wallet
59
+ category: salary
60
+ amount: 1000000
61
+ position: 0
62
+ date: 2009-08-02
63
+
64
+ sending:
65
+ type: Move
66
+ title: 振り込み
67
+ account_from: wallet
68
+ account_to: bank
69
+ category: withdraw
70
+ amount: 10000
71
+ position: 0
72
+ date: 2009-08-02
73
+
74
+ withdrawal:
75
+ type: Move
76
+ title: 引き出し
77
+ account_from: bank
78
+ account_to: wallet
79
+ category: withdraw
80
+ amount: 20000
81
+ position: 1
82
+ date: 2009-08-02
@@ -0,0 +1,11 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe AccountsHelper do
4
+
5
+ #Delete this example and add some real ones or delete this file
6
+ it "is included in the helper object" do
7
+ included_modules = (class << helper; self; end).send :included_modules
8
+ included_modules.should include(AccountsHelper)
9
+ end
10
+
11
+ end
@@ -0,0 +1,11 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe CategoriesHelper do
4
+
5
+ #Delete this example and add some real ones or delete this file
6
+ it "is included in the helper object" do
7
+ included_modules = (class << helper; self; end).send :included_modules
8
+ included_modules.should include(CategoriesHelper)
9
+ end
10
+
11
+ end
@@ -0,0 +1,11 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe ItemsHelper do
4
+
5
+ #Delete this example and add some real ones or delete this file
6
+ it "is included in the helper object" do
7
+ included_modules = (class << helper; self; end).send :included_modules
8
+ included_modules.should include(ItemsHelper)
9
+ end
10
+
11
+ end
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe Account do
4
+ fixtures :accounts, :incomes
5
+
6
+ it "should be valid" do
7
+ accounts(:bank).should be_valid
8
+ end
9
+
10
+ it "should have incomes" do
11
+ accounts(:bank).should have(1).incomes
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe Category do
4
+ fixtures :categories
5
+
6
+ it "should be valid" do
7
+ categories(:salary).should be_valid
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe Income do
4
+ fixtures :accounts, :categories, :incomes
5
+
6
+ it "should be valid" do
7
+ incomes(:august_sarary).should be_valid
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe Item do
4
+ before(:each) do
5
+ @valid_attributes = {
6
+
7
+ }
8
+ end
9
+
10
+ it "should create a new instance given valid attributes" do
11
+ Item.create!(@valid_attributes)
12
+ end
13
+ end
data/spec/rcov.opts ADDED
@@ -0,0 +1,2 @@
1
+ --exclude "spec/*,gems/*"
2
+ --rails
data/spec/spec.opts ADDED
@@ -0,0 +1,4 @@
1
+ --colour
2
+ --format progress
3
+ --loadby mtime
4
+ --reverse
@@ -0,0 +1,51 @@
1
+ # This file is copied to ~/spec when you run 'ruby script/generate rspec'
2
+ # from the project root directory.
3
+ ENV["RAILS_ENV"] ||= 'test'
4
+ require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
5
+ require 'spec/autorun'
6
+ require 'spec/rails'
7
+
8
+ # Requires supporting files with custom matchers and macros, etc,
9
+ # in ./support/ and its subdirectories.
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
11
+
12
+ Spec::Runner.configure do |config|
13
+ # If you're not using ActiveRecord you should remove these
14
+ # lines, delete config/database.yml and disable :active_record
15
+ # in your config/boot.rb
16
+ config.use_transactional_fixtures = true
17
+ config.use_instantiated_fixtures = false
18
+ config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
19
+
20
+ # == Fixtures
21
+ #
22
+ # You can declare fixtures for each example_group like this:
23
+ # describe "...." do
24
+ # fixtures :table_a, :table_b
25
+ #
26
+ # Alternatively, if you prefer to declare them only once, you can
27
+ # do so right here. Just uncomment the next line and replace the fixture
28
+ # names with your fixtures.
29
+ #
30
+ # config.global_fixtures = :table_a, :table_b
31
+ #
32
+ # If you declare global fixtures, be aware that they will be declared
33
+ # for all of your examples, even those that don't use them.
34
+ #
35
+ # You can also declare which fixtures to use (for example fixtures for test/fixtures):
36
+ #
37
+ # config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
38
+ #
39
+ # == Mock Framework
40
+ #
41
+ # RSpec uses it's own mocking framework by default. If you prefer to
42
+ # use mocha, flexmock or RR, uncomment the appropriate line:
43
+ #
44
+ # config.mock_with :mocha
45
+ # config.mock_with :flexmock
46
+ # config.mock_with :rr
47
+ #
48
+ # == Notes
49
+ #
50
+ # For more information take a look at Spec::Runner::Configuration and Spec::Runner
51
+ end