Skip to content

Commit

Permalink
Use octokit to fetch data, not submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliotJH committed Feb 14, 2014
1 parent ed61a4b commit d46ff47
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ end
group :test do
gem 'factory_girl_rails' # Factories for test data
end

gem 'octokit'
10 changes: 10 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ GEM
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
addressable (2.3.5)
arel (4.0.2)
atomic (1.1.14)
bcrypt-ruby (3.1.2)
Expand Down Expand Up @@ -79,6 +80,8 @@ GEM
factory_girl_rails (4.4.0)
factory_girl (~> 4.4.0)
railties (>= 3.0.0)
faraday (0.9.0)
multipart-post (>= 1.2, < 3)
foundation-rails (5.0.3.0)
railties (>= 3.1.0)
sass (>= 3.2.0)
Expand All @@ -105,12 +108,15 @@ GEM
mini_portile (0.5.2)
minitest (4.3.3)
multi_json (1.8.4)
multipart-post (2.0.0)
net-ldap (0.3.1)
net-scp (1.1.2)
net-ssh (>= 2.6.5)
net-ssh (2.8.0)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
octokit (2.7.1)
sawyer (~> 0.5.2)
orm_adapter (0.5.0)
paperclip (3.5.4)
activemodel (>= 3.0.0)
Expand Down Expand Up @@ -152,6 +158,9 @@ GEM
railties (>= 4.0.0, < 5.0)
sass (>= 3.1.10)
sprockets-rails (~> 2.0.0)
sawyer (0.5.3)
addressable (~> 2.3.5)
faraday (~> 0.8, < 0.10)
sdoc (0.4.0)
json (~> 1.8)
rdoc (~> 4.0, < 5.0)
Expand Down Expand Up @@ -215,6 +224,7 @@ DEPENDENCIES
leaflet-rails
meta_request
nokogiri
octokit
paperclip (~> 3.5.2)
pg
rails (= 4.0.2)
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/data_import.rake
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ namespace "import" do
CourseRepresentative.destroy_all


CSV.foreach(Rails.root.join('data', 'faculty_academic_officers.csv')) do |row|
CSV.parse(Base64.decode64(Octokit.contents("alphasusu/data", :path => "faculty_academic_officers.csv").content)) do |row|
if row[3] == "Faculty Officer"
faculty = Faculty.find_or_create_by(name: row[4])
if row[7].blank?
Expand Down Expand Up @@ -293,7 +293,7 @@ namespace "import" do
end
end

CSV.foreach(Rails.root.join('data', 'course_reps.csv'), headers: true) do |row|
CSV.parse(Base64.decode64(Octokit.contents("alphasusu/data", :path => "course_reps.csv").content), headers: true) do |row|
if !row[3].blank?
user = User.find_or_create_by(email: row[3].split("@")[0])
user.first_name = row[2].split(' ', 2)[0]
Expand Down

0 comments on commit d46ff47

Please sign in to comment.