Skip to content
This repository was archived by the owner on Aug 3, 2025. It is now read-only.

Commit 6103cd2

Browse files
authored
Merge pull request #14 from acm-uiuc/travis-ci
Travis CI
2 parents 1b3d683 + 6b91a40 commit 6103cd2

File tree

17 files changed

+314
-273
lines changed

17 files changed

+314
-273
lines changed

.rubocop.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Metrics/LineLength:
2+
Max: 120
3+
4+
# Offense count: 1
5+
# Configuration parameters: CountComments.
6+
Metrics/MethodLength:
7+
Max: 13
8+
9+
# Offense count: 12
10+
Style/AsciiComments:
11+
Enabled: false
12+
13+
# Offense count: 3
14+
Style/Documentation:
15+
Enabled: false
16+
17+
Style/SymbolArray:
18+
Enabled: true
19+
20+
Metrics/MethodLength:
21+
Enabled: false
22+
23+
Metrics/AbcSize:
24+
Enabled: false

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: ruby
2+
3+
rvm:
4+
- 2.2
5+
6+
before_install:
7+
- gem update bundler
8+
9+
install:
10+
- bundle install
11+
- gem install rubocop
12+
13+
script: rubocop *

Gemfile

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
11
# Copyright © 2017, ACM@UIUC
22
#
3-
# This file is part of the Groot Project.
4-
#
3+
# This file is part of the Groot Project.
4+
#
55
# The Groot Project is open source software, released under the University of
66
# Illinois/NCSA Open Source License. You should have received a copy of
77
# this license in a file with the distribution.
88
# app.rb
9-
source "https://rubygems.org"
9+
source 'https://rubygems.org'
1010

1111
gem 'bundler'
1212
gem 'rake'
1313

14+
gem 'foreigner'
1415
gem 'sinatra'
1516
gem 'sinatra-contrib'
16-
gem "sinatra-cross_origin", "~> 0.3.1"
17-
gem 'foreigner'
17+
gem 'sinatra-cross_origin', '~> 0.3.1'
1818

19-
gem 'json'
2019
gem 'data_mapper'
21-
gem 'dm-migrations'
20+
gem 'dm-constraints'
2221
gem 'dm-core'
23-
gem 'dm-timestamps'
22+
gem 'dm-migrations'
2423
gem 'dm-mysql-adapter'
25-
gem 'dm-constraints'
24+
gem 'dm-noisy-failures', '~> 0.2.3'
2625
gem 'dm-serializer'
26+
gem 'dm-timestamps'
2727
gem 'dm-validations'
28-
gem 'dm-noisy-failures', '~> 0.2.3'
28+
gem 'json'
2929

3030
group :test do
31-
gem "codeclimate-test-reporter", require: nil
32-
gem 'rspec'
33-
gem 'rack-test'
31+
gem 'codeclimate-test-reporter', require: nil
32+
gem 'database_cleaner'
3433
gem 'factory_girl'
35-
gem 'guard-rspec'
3634
gem 'faker'
35+
gem 'guard-rspec'
36+
gem 'rack-test'
37+
gem 'rspec'
3738
gem 'shoulda'
38-
gem 'database_cleaner'
3939
gem 'webmock'
4040
end
4141

4242
group :development, :test do
43-
gem 'pry'
44-
gem 'shotgun' # Auto-reload sinatra app on change.
4543
gem 'better_errors' # Show an awesome console in the browser on error.
46-
gem 'rest-client'
4744
gem 'binding_of_caller'
45+
gem 'pry'
46+
gem 'rest-client'
47+
gem 'shotgun' # Auto-reload sinatra app on change.
4848
end

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Groot Users Service
22

3+
[![Build Status](https://travis-ci.org/acm-uiuc/groot-users-service.svg?branch=master)](https://travis-ci.org/acm-uiuc/groot-users-service)
4+
35
Groot core development:
46

57
[![Join the chat at https://gitter.im/acm-uiuc/groot-development](https://badges.gitter.im/acm-uiuc/groot-development.svg)](https://gitter.im/acm-uiuc/groot-development?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Rakefile

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright © 2017, ACM@UIUC
22
#
3-
# This file is part of the Groot Project.
4-
#
3+
# This file is part of the Groot Project.
4+
#
55
# The Groot Project is open source software, released under the University of
66
# Illinois/NCSA Open Source License. You should have received a copy of
77
# this license in a file with the distribution.
@@ -11,56 +11,53 @@ require 'rake'
1111
require 'pry'
1212

1313
namespace :db do
14-
15-
desc "Migrate the database"
14+
desc 'Migrate the database'
1615
task :migrate do
17-
puts "Migrating database"
16+
puts 'Migrating database'
1817
DataMapper.auto_migrate!
1918
end
2019

21-
desc "Upgrade the database"
20+
desc 'Upgrade the database'
2221
task :upgrade do
23-
puts "Upgrading the database"
22+
puts 'Upgrading the database'
2423
DataMapper.auto_upgrade!
2524
end
2625

27-
desc "Populate the database with dummy data"
26+
desc 'Populate the database with dummy data'
2827
task :seed do
2928
DataMapper.auto_migrate!
30-
puts "Seeding database"
29+
puts 'Seeding database'
3130
require './scripts/seed.rb'
3231
end
3332

34-
desc "Load the database with data from liquid"
35-
task :liquid do
36-
37-
# Delete data and load from schema
38-
DataMapper.auto_migrate!
39-
require './scripts/liquid.rb'
40-
end
33+
desc 'Load the database with data from liquid'
34+
task :liquid do
35+
# Delete data and load from schema
36+
DataMapper.auto_migrate!
37+
require './scripts/liquid.rb'
38+
end
4139
end
4240

4341
desc 'Start Pry with application environment loaded'
44-
task :pry do
45-
exec "pry -r./init.rb"
42+
task :pry do
43+
exec 'pry -r./init.rb'
4644
end
4745

4846
namespace :routes do
49-
desc 'Print all the routes'
50-
task :show do
51-
Sinatra::Application.routes.each_pair do |method, list|
52-
puts ":: #{method} ::"
53-
routes = []
54-
list.each do |item|
55-
source = item[0].source
56-
item[1].each do |s|
57-
source.sub!(/\(.+?\)/, ':'+s)
58-
end
59-
routes << source[2...-2]
60-
end
61-
puts routes.sort.join("\n")
62-
puts "\n"
47+
desc 'Print all the routes'
48+
task :show do
49+
Sinatra::Application.routes.each_pair do |method, list|
50+
puts ":: #{method} ::"
51+
routes = []
52+
list.each do |item|
53+
source = item[0].source
54+
item[1].each do |s|
55+
source.sub!(/\(.+?\)/, ':' + s)
6356
end
57+
routes << source[2...-2]
58+
end
59+
puts routes.sort.join("\n")
60+
puts "\n"
6461
end
62+
end
6563
end
66-

app.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright © 2017, ACM@UIUC
22
#
3-
# This file is part of the Groot Project.
4-
#
3+
# This file is part of the Groot Project.
4+
#
55
# The Groot Project is open source software, released under the University of
66
# Illinois/NCSA Open Source License. You should have received a copy of
77
# this license in a file with the distribution.
@@ -14,7 +14,7 @@
1414
require 'data_mapper'
1515
require 'dm-migrations'
1616
require 'dm-serializer'
17-
require "dm_noisy_failures"
17+
require 'dm_noisy_failures'
1818
require 'dm-core'
1919
require 'dm-timestamps'
2020
require 'dm-validations'
@@ -30,32 +30,32 @@
3030
register Sinatra::CrossOrigin
3131

3232
configure do
33-
enable :cross_origin
33+
enable :cross_origin
3434
end
3535

3636
set :root, File.expand_path('..', __FILE__)
3737
set :port, 8001
3838
set :bind, '0.0.0.0'
3939

40-
db = Config.load_config("database")
40+
db = Config.load_config('database')
4141
DataMapper.setup(
42-
:default,
43-
"mysql://" + db["user"] + ":" + db["password"] + "@" + db["hostname"]+ "/" + db["name"]
42+
:default,
43+
'mysql://' + db['user'] + ':' + db['password'] + '@' + db['hostname'] + '/' + db['name']
4444
)
4545

4646
configure :development do
47-
enable :unsecure
48-
49-
DataMapper::Logger.new($stdout, :debug)
50-
use BetterErrors::Middleware
51-
52-
BetterErrors.application_root = File.expand_path('..', __FILE__)
53-
DataMapper.auto_upgrade!
47+
enable :unsecure
48+
49+
DataMapper::Logger.new($stdout, :debug)
50+
use BetterErrors::Middleware
51+
52+
BetterErrors.application_root = File.expand_path('..', __FILE__)
53+
DataMapper.auto_upgrade!
5454
end
5555

5656
configure :production do
57-
disable :unsecure
58-
DataMapper.finalize
57+
disable :unsecure
58+
DataMapper.finalize
5959
end
6060

6161
DataMapper.finalize

0 commit comments

Comments
 (0)