Skip to content

Commit e44543a

Browse files
author
attdevsupport
committed
Sample App Code 12/17 Release
1 parent 515812c commit e44543a

File tree

656 files changed

+22097
-15623
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

656 files changed

+22097
-15623
lines changed

RESTFul/ADS/Ruby/app1/.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Compiled source #
2+
###################
3+
*.com
4+
*.class
5+
*.dll
6+
*.exe
7+
*.o
8+
*.so
9+
10+
# Packages #
11+
############
12+
# it's better to unpack these files and commit the raw source
13+
# git has its own built in compression methods
14+
*.7z
15+
*.dmg
16+
*.gz
17+
*.iso
18+
*.jar
19+
*.rar
20+
*.tar
21+
*.zip
22+
*.gem
23+
24+
# Logs and databases #
25+
######################
26+
*.log
27+
*.sql
28+
*.sqlite
29+
*.db
30+
31+
# OS generated files #
32+
######################
33+
.DS_Store
34+
.DS_Store?
35+
._*
36+
.Spotlight-V100
37+
.Trashes
38+
Icon?
39+
ehthumbs.db
40+
Thumbs.db
41+
*.swp
42+
*.swo
43+
44+
# Custom ignores #
45+
##################
46+
sync.sh
47+
excludes.txt
48+
49+
# Less CSS ignores #
50+
####################
51+
Less-CSS/*.css
52+
53+
# eclipse files
54+
.classpath
55+
.project
56+
.settings
57+
target/
58+
59+
# docs
60+
.yardoc/
61+
doc/

RESTFul/ADS/Ruby/app1/Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ source "https://rubygems.org"
33

44
gem 'sinatra', '~>1.4'
55
gem 'sinatra-contrib'
6+
gem 'immutable_struct', '~>1.1'
67
gem 'json', '~>1.8'
78
gem 'thin', '~>1.6'
9+
gem 'mime-types', '~>1.0'
810
gem 'rack', '~>1.5'
911
gem 'rest-client', '~>1.6'
1012

RESTFul/ADS/Ruby/app1/Gemfile.lock

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ GEM
22
remote: https://rubygems.org/
33
remote: http://ldev.code-api-att.com:8808/
44
specs:
5-
att-codekit (3.0.2)
5+
att-codekit (3.1.3)
66
bundler (~> 1.3)
77
immutable_struct
88
json
@@ -12,40 +12,42 @@ GEM
1212
daemons (1.1.9)
1313
eventmachine (1.0.3)
1414
immutable_struct (1.1.1)
15-
json (1.8.0)
16-
mime-types (1.25)
17-
multi_json (1.8.1)
15+
json (1.8.1)
16+
mime-types (1.25.1)
17+
multi_json (1.8.2)
1818
rack (1.5.2)
19-
rack-protection (1.5.0)
19+
rack-protection (1.5.1)
2020
rack
2121
rack-test (0.6.2)
2222
rack (>= 1.0)
2323
rake (10.1.0)
2424
rest-client (1.6.7)
2525
mime-types (>= 1.16)
26-
sinatra (1.4.3)
26+
sinatra (1.4.4)
2727
rack (~> 1.4)
2828
rack-protection (~> 1.4)
2929
tilt (~> 1.3, >= 1.3.4)
30-
sinatra-contrib (1.4.1)
30+
sinatra-contrib (1.4.2)
3131
backports (>= 2.0)
3232
multi_json
3333
rack-protection
3434
rack-test
3535
sinatra (~> 1.4.0)
3636
tilt (~> 1.3)
37-
thin (1.6.0)
37+
thin (1.6.1)
3838
daemons (>= 1.0.9)
3939
eventmachine (>= 1.0.0)
40-
rack (>= 1.5.0)
40+
rack (>= 1.0.0)
4141
tilt (1.4.1)
4242

4343
PLATFORMS
4444
ruby
4545

4646
DEPENDENCIES
4747
att-codekit (~> 3.0)
48+
immutable_struct (~> 1.1)
4849
json (~> 1.8)
50+
mime-types (~> 1.0)
4951
rack (~> 1.5)
5052
rest-client (~> 1.6)
5153
sinatra (~> 1.4)

RESTFul/ADS/Ruby/app1/ads.rb

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,19 @@
1010
require 'sinatra'
1111
require 'open-uri'
1212
require 'sinatra/config_file'
13-
require 'att/codekit'
13+
14+
# require as a gem file load relative if fails
15+
begin
16+
require 'att/codekit'
17+
rescue LoadError
18+
# try relative, fall back to ruby 1.8 method if fails
19+
begin
20+
require_relative 'codekit/lib/att/codekit'
21+
rescue NoMethodError
22+
require File.join(File.dirname(__FILE__), 'codekit/lib/att/codekit')
23+
end
24+
end
25+
1426

1527
#simplify our namespace
1628
include Att::Codekit
@@ -42,11 +54,15 @@
4254
# Setup filter for token handling
4355
[ '/getAds' ].each do |action|
4456
before action do
45-
if @@token.nil?
46-
@@token = OAuth.createToken(SCOPE)
47-
end
48-
if @@token.expired?
49-
@@token = OAuth.refreshToken(@@token)
57+
begin
58+
if @@token.nil?
59+
@@token = OAuth.createToken(SCOPE)
60+
end
61+
if @@token && @@token.expired?
62+
@@token = OAuth.refreshToken(@@token)
63+
end
64+
rescue Exception => e
65+
@error = e.message
5066
end
5167
end
5268
end

RESTFul/ADS/Ruby/app1/att/codekit.rb

Lines changed: 0 additions & 15 deletions
This file was deleted.

RESTFul/ADS/Ruby/app1/att/codekit/auth.rb

Lines changed: 0 additions & 13 deletions
This file was deleted.

RESTFul/ADS/Ruby/app1/att/codekit/model/ads_response.rb

Lines changed: 0 additions & 25 deletions
This file was deleted.

RESTFul/ADS/Ruby/app1/att/codekit/model/cms_response.rb

Lines changed: 0 additions & 17 deletions
This file was deleted.

RESTFul/ADS/Ruby/app1/att/codekit/model/dc_response.rb

Lines changed: 0 additions & 59 deletions
This file was deleted.

RESTFul/ADS/Ruby/app1/att/codekit/model/immn_response.rb

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)