mirror of
https://github.com/gwenhael-le-moine/ledgerrb.git
synced 2024-11-15 19:48:01 +01:00
Gemfile -> gems
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
This commit is contained in:
parent
a1c1b5b167
commit
b477f59dcc
7 changed files with 65 additions and 88 deletions
37
Gemfile.lock
37
Gemfile.lock
|
@ -1,37 +0,0 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
coderay (1.1.1)
|
||||
method_source (0.8.2)
|
||||
pry (0.10.4)
|
||||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.8.1)
|
||||
slop (~> 3.4)
|
||||
puma (3.6.0)
|
||||
rack (1.6.4)
|
||||
rack-protection (1.5.3)
|
||||
rack
|
||||
rack-rewrite (1.5.1)
|
||||
rake (11.2.2)
|
||||
sinatra (1.4.7)
|
||||
rack (~> 1.5)
|
||||
rack-protection (~> 1.4)
|
||||
tilt (>= 1.3, < 3)
|
||||
sinatra-param (1.4.0)
|
||||
sinatra (~> 1.3)
|
||||
slop (3.6.0)
|
||||
tilt (2.0.5)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
pry
|
||||
puma
|
||||
rack-rewrite
|
||||
rake
|
||||
sinatra
|
||||
sinatra-param
|
||||
|
||||
BUNDLED WITH
|
||||
1.12.5
|
25
app.rb
25
app.rb
|
@ -1,15 +1,15 @@
|
|||
# encoding: utf-8
|
||||
|
||||
require 'json'
|
||||
require 'bundler'
|
||||
|
||||
Bundler.require( :default, ENV[ 'RACK_ENV' ].to_sym )
|
||||
|
||||
require_relative './config/options'
|
||||
require_relative './lib/ledger'
|
||||
|
||||
# Sinatra app serving API
|
||||
class LedgerRbApp < Sinatra::Base
|
||||
helpers Sinatra::Param
|
||||
|
||||
before do
|
||||
content_type :json, 'charset' => 'utf-8'
|
||||
end
|
||||
|
@ -19,13 +19,16 @@ class LedgerRbApp < Sinatra::Base
|
|||
send_file './public/app/index.html'
|
||||
end
|
||||
|
||||
get '/budget' do
|
||||
content_type :html
|
||||
erb :budget
|
||||
end
|
||||
|
||||
get '/api/ledger/accounts/?' do
|
||||
Ledger.accounts.to_json
|
||||
end
|
||||
|
||||
get '/api/ledger/accounts/depth/:depth/?' do
|
||||
param :depth, Integer, required: true
|
||||
|
||||
Ledger.accounts( params[ :depth ] ).to_json
|
||||
end
|
||||
|
||||
|
@ -34,20 +37,12 @@ class LedgerRbApp < Sinatra::Base
|
|||
end
|
||||
|
||||
get '/api/ledger/register/?' do
|
||||
param :period, String, default: nil
|
||||
param :categories, String, required: true
|
||||
|
||||
{ key: params[ :categories ],
|
||||
values: Ledger.register( params[ :period ], params[ :categories ] ) }
|
||||
.to_json
|
||||
end
|
||||
|
||||
get '/api/ledger/balance/?' do
|
||||
param :depth, Integer, default: false
|
||||
param :period, String, default: nil
|
||||
param :cleared, Boolean, default: false
|
||||
param :categories, String, default: ''
|
||||
|
||||
Ledger.balance( params[ :cleared ],
|
||||
params[ :depth ],
|
||||
params[ :period ],
|
||||
|
@ -60,17 +55,11 @@ class LedgerRbApp < Sinatra::Base
|
|||
end
|
||||
|
||||
get '/api/ledger/budget/?' do
|
||||
param :period, String, default: 'this month'
|
||||
param :categories, String, required: true
|
||||
|
||||
Ledger.budget( params[ :period ],
|
||||
params[ :categories ] ).to_json
|
||||
end
|
||||
|
||||
get '/api/ledger/graph_values/?' do
|
||||
param :period, String, default: nil
|
||||
param :categories, String, default: 'Expenses'
|
||||
|
||||
Ledger.graph_values( params[:period], params[:categories].split(' ') ).to_json
|
||||
end
|
||||
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
# encoding: utf-8
|
||||
|
||||
require 'bundler'
|
||||
|
||||
require_relative './config/options'
|
||||
require_relative './app'
|
||||
|
||||
use Rack::Rewrite do
|
||||
rewrite %r{^/(.*(css|js|ttf|woff|html|png|jpg|jpeg|gif|ico)$)}, '/app/$1'
|
||||
map "/" do
|
||||
run LedgerRbApp
|
||||
end
|
||||
|
||||
run LedgerRbApp
|
||||
|
|
32
gems.locked
Normal file
32
gems.locked
Normal file
|
@ -0,0 +1,32 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
coderay (1.1.2)
|
||||
method_source (0.9.0)
|
||||
mustermann (1.0.1)
|
||||
pry (0.11.1)
|
||||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.9.0)
|
||||
puma (3.10.0)
|
||||
rack (2.0.3)
|
||||
rack-protection (2.0.0)
|
||||
rack
|
||||
rake (12.1.0)
|
||||
sinatra (2.0.0)
|
||||
mustermann (~> 1.0)
|
||||
rack (~> 2.0)
|
||||
rack-protection (= 2.0.0)
|
||||
tilt (~> 2.0)
|
||||
tilt (2.0.8)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
pry
|
||||
puma
|
||||
rake
|
||||
sinatra
|
||||
|
||||
BUNDLED WITH
|
||||
1.14.3
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'rack-rewrite'
|
||||
gem 'sinatra'
|
||||
gem 'sinatra-param'
|
||||
gem 'puma'
|
||||
gem 'rake'
|
||||
gem 'pry'
|
|
@ -12,9 +12,9 @@
|
|||
|
||||
<link type="image/x-icon" rel="icon" href="/favicon.ico" />
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="/vendor/node_modules/nvd3/build/nv.d3.min.css">
|
||||
<link type="text/css" rel="stylesheet" href="/vendor/node_modules/angular-loading-bar/build/loading-bar.min.css">
|
||||
<link type="text/css" rel="stylesheet" href="/vendor/node_modules/angular-material/angular-material.min.css">
|
||||
<link type="text/css" rel="stylesheet" href="/app/vendor/node_modules/nvd3/build/nv.d3.min.css">
|
||||
<link type="text/css" rel="stylesheet" href="/app/vendor/node_modules/angular-loading-bar/build/loading-bar.min.css">
|
||||
<link type="text/css" rel="stylesheet" href="/app/vendor/node_modules/angular-material/angular-material.min.css">
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="/css/app.css"/>
|
||||
</head>
|
||||
|
@ -23,27 +23,27 @@
|
|||
<div class="main" role="main" tabindex="-1" layout="column"
|
||||
ui-view="main"></div>
|
||||
|
||||
<script src="/vendor/node_modules/underscore/underscore-min.js"></script>
|
||||
<script src="/vendor/node_modules/moment/min/moment-with-locales.min.js"></script>
|
||||
<script src="/vendor/node_modules/hammerjs/hammer.min.js"></script>
|
||||
<script src="/vendor/node_modules/d3/d3.min.js"></script>
|
||||
<script src="/vendor/node_modules/nvd3/build/nv.d3.min.js"></script>
|
||||
<script src="/app/vendor/node_modules/underscore/underscore-min.js"></script>
|
||||
<script src="/app/vendor/node_modules/moment/min/moment-with-locales.min.js"></script>
|
||||
<script src="/app/vendor/node_modules/hammerjs/hammer.min.js"></script>
|
||||
<script src="/app/vendor/node_modules/d3/d3.min.js"></script>
|
||||
<script src="/app/vendor/node_modules/nvd3/build/nv.d3.min.js"></script>
|
||||
|
||||
<script src="/vendor/node_modules/angular/angular.min.js"></script>
|
||||
<script src="/vendor/node_modules/angular-i18n/angular-locale_en-us.js"></script>
|
||||
<script src="/vendor/node_modules/angular-ui-router/release/angular-ui-router.min.js"></script>
|
||||
<script src="/vendor/node_modules/angular-aria/angular-aria.min.js"></script>
|
||||
<script src="/vendor/node_modules/angular-animate/angular-animate.min.js"></script>
|
||||
<script src="/vendor/node_modules/angular-material/angular-material.min.js"></script>
|
||||
<script src="/vendor/node_modules/angular-moment/angular-moment.min.js"></script>
|
||||
<script src="/vendor/node_modules/angular-nvd3/dist/angular-nvd3.min.js"></script>
|
||||
<script src="/vendor/node_modules/angular-loading-bar/build/loading-bar.min.js"></script>
|
||||
<script src="/app/vendor/node_modules/angular/angular.min.js"></script>
|
||||
<script src="/app/vendor/node_modules/angular-i18n/angular-locale_en-us.js"></script>
|
||||
<script src="/app/vendor/node_modules/angular-ui-router/release/angular-ui-router.min.js"></script>
|
||||
<script src="/app/vendor/node_modules/angular-aria/angular-aria.min.js"></script>
|
||||
<script src="/app/vendor/node_modules/angular-animate/angular-animate.min.js"></script>
|
||||
<script src="/app/vendor/node_modules/angular-material/angular-material.min.js"></script>
|
||||
<script src="/app/vendor/node_modules/angular-moment/angular-moment.min.js"></script>
|
||||
<script src="/app/vendor/node_modules/angular-nvd3/dist/angular-nvd3.min.js"></script>
|
||||
<script src="/app/vendor/node_modules/angular-loading-bar/build/loading-bar.min.js"></script>
|
||||
|
||||
<!-- APP -->
|
||||
<script src="/js/app.js"></script>
|
||||
<script src="/js/state.js"></script>
|
||||
<script src="/js/services/API.js"></script>
|
||||
<script src="/js/controllers/DashboardCtrl.js"></script>
|
||||
<script src="/app/js/app.js"></script>
|
||||
<script src="/app/js/state.js"></script>
|
||||
<script src="/app/js/services/API.js"></script>
|
||||
<script src="/app/js/controllers/DashboardCtrl.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -6,14 +6,14 @@ app.config( [ '$stateProvider', '$urlRouterProvider',
|
|||
url: '',
|
||||
views: {
|
||||
'main': {
|
||||
templateUrl: 'js/templates/dashboard.html',
|
||||
templateUrl: 'app/js/templates/dashboard.html',
|
||||
controller: 'DashboardCtrl'
|
||||
}
|
||||
}
|
||||
} )
|
||||
.state( '404', {
|
||||
url: '/404',
|
||||
templateUrl: 'js/templates/404.html'
|
||||
templateUrl: 'app/js/templates/404.html'
|
||||
} );
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue