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.
- data/.gitignore +5 -0
- data/.gitmodules +6 -0
- data/Changelog +21 -0
- data/README +1 -0
- data/Rakefile +32 -0
- data/VERSION +1 -0
- data/app/controllers/accounts_controller.rb +99 -0
- data/app/controllers/application_controller.rb +10 -0
- data/app/controllers/categories_controller.rb +99 -0
- data/app/controllers/home_controller.rb +31 -0
- data/app/controllers/items_controller.rb +105 -0
- data/app/controllers/logs_controller.rb +20 -0
- data/app/helpers/accounts_helper.rb +2 -0
- data/app/helpers/application_helper.rb +3 -0
- data/app/helpers/categories_helper.rb +2 -0
- data/app/helpers/home_helper.rb +2 -0
- data/app/helpers/items_helper.rb +2 -0
- data/app/helpers/logs_helper.rb +42 -0
- data/app/models/account.rb +12 -0
- data/app/models/category.rb +26 -0
- data/app/models/expense.rb +2 -0
- data/app/models/income.rb +2 -0
- data/app/models/item.rb +31 -0
- data/app/models/move.rb +37 -0
- data/app/models/simple_item.rb +27 -0
- data/app/views/accounts/edit.html.erb +16 -0
- data/app/views/accounts/index.html.erb +24 -0
- data/app/views/accounts/new.html.erb +15 -0
- data/app/views/accounts/show.html.erb +8 -0
- data/app/views/categories/edit.html.erb +20 -0
- data/app/views/categories/index.html.erb +26 -0
- data/app/views/categories/new.html.erb +19 -0
- data/app/views/categories/show.html.erb +13 -0
- data/app/views/home/index.html.erb +15 -0
- data/app/views/items/edit.html.erb +45 -0
- data/app/views/items/index.html.erb +38 -0
- data/app/views/items/new.html.erb +40 -0
- data/app/views/items/show.html.erb +3 -0
- data/app/views/layouts/application.html.erb +37 -0
- data/app/views/logs/view.html.erb +120 -0
- data/config/boot.rb +110 -0
- data/config/database.yml +25 -0
- data/config/environment.rb +41 -0
- data/config/environments/cucumber.rb +21 -0
- data/config/environments/development.rb +17 -0
- data/config/environments/production.rb +28 -0
- data/config/environments/test.rb +28 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/inflections.rb +10 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/new_rails_defaults.rb +19 -0
- data/config/initializers/session_store.rb +15 -0
- data/config/locales/en.yml +5 -0
- data/config/routes.rb +80 -0
- data/db/migrate/20090802070406_create_accounts.rb +14 -0
- data/db/migrate/20090802073601_create_categories.rb +15 -0
- data/db/migrate/20090804065900_create_items.rb +26 -0
- data/doc/README_FOR_APP +2 -0
- data/features/step_definitions/webrat_steps.rb +129 -0
- data/features/support/env.rb +37 -0
- data/features/support/paths.rb +27 -0
- data/lib/tasks/cucumber.rake +20 -0
- data/lib/tasks/rspec.rake +182 -0
- data/main.rb +5 -0
- data/moneyrail.gemspec +170 -0
- data/public/404.html +30 -0
- data/public/422.html +30 -0
- data/public/500.html +30 -0
- data/public/favicon.ico +0 -0
- data/public/images/rails.png +0 -0
- data/public/javascripts/application.js +2 -0
- data/public/javascripts/controls.js +963 -0
- data/public/javascripts/dragdrop.js +973 -0
- data/public/javascripts/editor.js +188 -0
- data/public/javascripts/effects.js +1128 -0
- data/public/javascripts/jquery-ui.js +160 -0
- data/public/javascripts/jquery.js +32 -0
- data/public/javascripts/prototype.js +4320 -0
- data/public/robots.txt +5 -0
- data/public/stylesheets/editor.less +67 -0
- data/script/about +4 -0
- data/script/autospec +6 -0
- data/script/console +3 -0
- data/script/cucumber +8 -0
- data/script/dbconsole +3 -0
- data/script/destroy +3 -0
- data/script/generate +3 -0
- data/script/performance/benchmarker +3 -0
- data/script/performance/profiler +3 -0
- data/script/plugin +3 -0
- data/script/runner +3 -0
- data/script/server +3 -0
- data/script/spec +10 -0
- data/script/spec_server +9 -0
- data/spec/_fixtures/accounts.yml +5 -0
- data/spec/_fixtures/categories.yml +19 -0
- data/spec/_fixtures/incomes.yml +7 -0
- data/spec/_fixtures/items.yml +7 -0
- data/spec/fixtures/accounts.yml +11 -0
- data/spec/fixtures/categories.yml +24 -0
- data/spec/fixtures/items.yml +82 -0
- data/spec/helpers/accounts_helper_spec.rb +11 -0
- data/spec/helpers/categories_helper_spec.rb +11 -0
- data/spec/helpers/items_helper_spec.rb +11 -0
- data/spec/models/account_spec.rb +13 -0
- data/spec/models/category_spec.rb +9 -0
- data/spec/models/income_spec.rb +9 -0
- data/spec/models/item_spec.rb +13 -0
- data/spec/rcov.opts +2 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +51 -0
- data/vendor/plugins/acts_as_list/README +23 -0
- data/vendor/plugins/acts_as_list/init.rb +3 -0
- data/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +256 -0
- data/vendor/plugins/acts_as_list/test/list_test.rb +332 -0
- data/vendor/plugins/less/LICENCE +20 -0
- data/vendor/plugins/less/README +52 -0
- data/vendor/plugins/less/init.rb +19 -0
- data/vendor/plugins/less/lib/less_for_rails.rb +37 -0
- data/vendor/plugins/less/test/less_for_rails_test.rb +15 -0
- metadata +201 -0
data/public/robots.txt
ADDED
@@ -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
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
data/script/cucumber
ADDED
data/script/dbconsole
ADDED
data/script/destroy
ADDED
data/script/generate
ADDED
data/script/plugin
ADDED
data/script/runner
ADDED
data/script/server
ADDED
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
|
data/script/spec_server
ADDED
@@ -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,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,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,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
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
@@ -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
|