diff --git a/github-challenge/challenge.rb b/github-challenge/challenge.rb
new file mode 100644
index 0000000..62ff49f
--- /dev/null
+++ b/github-challenge/challenge.rb
@@ -0,0 +1,20 @@
+require 'open-uri'
+require 'yaml'
+github_response = open("https://github.com/api/v2/yaml/commits/list/rails/rails/master")
+github_hash = YAML::load(github_response.read)
+github_sort = github_hash['commits'].group_by { |commit| commit['author'] }
+the_html = "
Github Commits by AuthorRecent Github Commits by Author
"
+github_sort.each do |author, author_commits|
+ the_html += "#{author['name']}
"
+ the_html += ""
+ author_commits.each do |commit|
+ the_html += "- Commit: #{commit['id']}
"
+ the_html += commit['message']
+ the_html += " "
+ end
+ the_html += "
"
+end
+the_html += ""
+f = File.open('github_challenge.html','w')
+f.puts the_html
+f.close
diff --git a/github-challenge/github_challenge.html b/github-challenge/github_challenge.html
new file mode 100644
index 0000000..5ce0d50
--- /dev/null
+++ b/github-challenge/github_challenge.html
@@ -0,0 +1,43 @@
+Github Commits by AuthorRecent Github Commits by Author
Don Wilson
- Commit: c4d977fbbc31b0a6c7557846f9fe01e688a6f845
Added :negative_format option to number_to_currency function [#5894 state:resolved]
+
+Signed-off-by: Andrew White
Aaron Patterson
- Commit: 63625388154043dd6cde755f62c095dad87ad173
add more tests surrounding camlize in xmlmini, refactor rename_key() - Commit: 296467fcc40bb3c6a4f42dedc267eb4f313843a9
only returning where values for the corresponding relation, also filtering where value hash based on table name [#5234 state:resolved] [#5184 state:resolved] - Commit: cbca12f9086826dd7243c7c847deea89bbe026b1
adding tests for #5234 and #5184. Tests were from Akira Matsuda. Thanks Akira! - Commit: 7d5762d2c2147f8240614997682e5e535a3e4f33
no need to merge where values if no new where values have been added - Commit: 2b48e476540c946579007188e59fd393bdf7a163
ruby-debug19 does not work with 1.9.3, so I am removing it - Commit: 67a3a702951dae905b6270d652dbd14853b01c26
refactoring find_join_association - Commit: 2a47e7ef105559c4c931efff8fd14c454a21cf7a
only do string substitution on column names once, remove intermediate data structures - Commit: 2e07260f36f3e192e5f0b51b287700b419fd1019
columns are always strings - Commit: 6cf44a1bd64ba10497742d70ad78fe68faa16e99
no need to to_i, sqlite does that for us - Commit: 6a3d6b7f1352efd3e7b931533740252b04850e27
select_all() should always return an array, so no need to test - Commit: f6ddb3553a38d7d479b0177ff29eb4a2a3c17e9f
fisting test name - Commit: 9ce02118061fda778e592be83f7c4c3c7c75bfbf
speeding up query cache - Commit: 7104122cc3fca4939d77a6780910cd98ff02fab0
making query cache work with prepared statements - Commit: e73b0b84d939af241dfbba8931d8add9724595e4
renaming bind_values to binds where it makes sense - Commit: 104d0b263e5d9b17216f06c72d422d26ca5a537f
adding backwards compatibility for non-prepare statement handling drivers - Commit: fca229e205e7d417a025198825cfe19c5c395bff
caching column values
Xavier Noria
- Commit: 208fb2920d6c6c6be97a7086cea24f4c8220010c
made a pass to the docs of :negative_format - Commit: 3cf85fb4fcdae65a4d5a1a5c418492ea0cf9ad6d
Merge branch 'master' of git://github.com/lifo/docrails
Jeremy Holland
- Commit: ea0faa2055fbbe6ac9ebe960ddf4bea8adda287a
Allowing to_xml :camelize option to be set to :lower to enable lower-camelcase tags [#5903 state:resolved]
Jon Leighton
- Commit: b82fab25f999dd6245c23a22f948048eef2d5d9a
Refactoring: replace the mix of variables like @finder_sql, @counter_sql, etc with just a single scope hash (created on initialization of the proxy). This is now used consistently across all associations. Therefore, all you have to do to ensure finding/counting etc is done correctly is implement the scope correctly.
Denis Odorcic
- Commit: cc9742920ccaf8e985fbe5239edb966949eb91c3
Convert :primary_key in association to a string before comparing to column names, so that for example :primary_key => :another_pk works as well [#5605 state:resolved]
Pratik Naik
- Commit: 18b6aa65389cd10d62dc0005e632a3a2d474dec4
Make should_record_timestamps? serialization aware rather than object#changed? - Commit: e911ed1f0f1633b0ae1b5146805eee6388b1f02f
Ensure save always updates timestamps when serialized attributes are present - Commit: c5c2e4fefde539e1c1753d4ca184c3bf81d496be
Add timestamps to Topic
Andrew White
- Commit: d446392f76c063d9f04396a1d3ca9e314a521671
Add additional HTTP request methods from the following RFCs:
+
+* Hypertext Transfer Protocol -- HTTP/1.1
+ http://www.ietf.org/rfc/rfc2616.txt)
+
+* HTTP Extensions for Distributed Authoring -- WEBDAV
+ http://www.ietf.org/rfc/rfc2518.txt
+
+* Versioning Extensions to WebDAV
+ http://www.ietf.org/rfc/rfc3253.txt
+
+* Ordered Collections Protocol (WebDAV)
+ http://www.ietf.org/rfc/rfc3648.txt
+
+* Web Distributed Authoring and Versioning (WebDAV) Access Control Protocol
+ http://www.ietf.org/rfc/rfc3744.txt
+
+* Web Distributed Authoring and Versioning (WebDAV) SEARCH
+ http://www.ietf.org/rfc/rfc5323.txt
+
+* PATCH Method for HTTP
+ http://www.ietf.org/rfc/rfc5789.txt
+
+[#2809 state:resolved] [#5895 state:resolved] - Commit: 47ceb135c6b75988f2712bc44db397b992c1c731
Ensure that Rails.env is defined first
snusnu
- Commit: 973b90877755522772480bce73fcbc17320da2ef
Added missing AS require to active_model/naming.rb
+
+We saw a failing spec when running the DataMapper
+ActiveModel compliance specs for dm-active_model.
+
+ ActiveModel::Naming#model_name
+
+relies on the Module#parents method defined in
+
+ active_support/core_ext/module/introspection.rb
+
+Adding the appropriate require statement of course
+fixed our specs.
Ernie Miller
- Commit: 0bb85ed9ffa9808926b46e8f7e59cab5b85ac19f
Fix issues when including the same association multiple times and mixing joins/includes together.
Jeff Kreeftmeijer
- Commit: bb9c58eb4aa637fa75c69c705a9918d6322ff834
Make sure capture's output gets html_escaped [#5545 state:resolved]
+
+Also remove a duplicate test_link_to_unless assertion and add .html_safe to the
+remaining one.
+
+Signed-off-by: Santiago Pastorino
Aditya Sanghi
- Commit: 3ca16650389aa0d186a441f74b54a409cce4b392
reverting last change to javascript helper; needs more investigation - Commit: 74f3f74b6e6a33abe645a5e9d1bb04cb58676575
fixed javascript helper doc to close issue #10 raised by jialin
Santiago Pastorino
- Commit: d7ec94f66580abceffd313b943636ef113ffa662
Just initialize options with an empty hash - Commit: 3c7215bdce30aaaa6b86f5ec905c981346e170eb
Test that capture doesn't escape twice - Commit: 72d12d94559f7c124fa2ec88eb668ad2948c02f4
Call as ERB::Util.html_escape since is not the module is not included here
diff --git a/refactor-this/helper.rb b/refactor-this/helper.rb
index 6ef273b..0c6cac9 100644
--- a/refactor-this/helper.rb
+++ b/refactor-this/helper.rb
@@ -1,67 +1,38 @@
class Helper
- def self.foo
- "foo"
- end
-
- def image_size(profile, non_rep_size)
- if profile.user.rep?
- '190x114'
- else
- non_rep_size
- end
- end
-
- def display_small_photo(profile, html = {}, options = {})
- display_photo(profile, image_size(profile, "32x32"), html, options)
- end
- def display_medium_photo(profile, html = {}, options = {})
- display_photo(profile, image_size(profile, "48x48"), html, options)
+ def set_image_default_html(html = {})
+ html.reverse_merge!(:class => 'thumbnail', :size => size, :title => "Link to #{profile.name}")
end
- def display_large_photo(profile, html = {}, options = {}, link = true)
- display_photo(profile, image_size(profile, "64x64"), html, options, link)
+ def user_has_photo?(profile)
+ return true if profile.user && profile.user.photo
end
- def display_huge_photo(profile, html = {}, options = {}, link = true)
- display_photo(profile, image_size(profile, "200x200"), html, options, link)
+ def is_user_rep?(profile)
+ return true if profile.user && profile.user.rep?
end
def display_photo(profile, size, html = {}, options = {}, link = true)
return image_tag("wrench.png") unless profile # this should not happen
- show_default_image = !(options[:show_default] == false)
- html.reverse_merge!(:class => 'thumbnail', :size => size, :title => "Link to #{profile.name}")
+ html = set_image_default_html(html)
- if profile && profile.user
- if profile.user && profile.user.photo && File.exists?(profile.user.photo)
- @user = profile.user
- if link
- return link_to(image_tag(url_for_file_column("user", "photo", size), html), profile_path(profile) )
- else
- return image_tag(url_for_file_column("user", "photo", size), html)
- end
- else
- show_default_image ? default_photo(profile, size, {}, link) : ''
- end
+ if user_has_photo?(profile)
+ return link_to(image_tag(url_for_file_column("user", "photo", size), html), profile_path(profile) ) if link
+ return image_tag(url_for_file_column("user", "photo", size), html)
end
- show_default_image ? default_photo(profile, size, {}, link) : ''
+ show_default_image = !(options[:show_default] == false)
+ return show_default_image ? default_photo(profile, size, {}, link) : 'NO DEFAULT' # Fix missing message
end
def default_photo(profile, size, html={}, link = true)
if link
- if profile.user.rep?
- link_to(image_tag("user190x119.jpg", html), profile_path(profile) )
- else
- link_to(image_tag("user#{size}.jpg", html), profile_path(profile) )
- end
- else
- if profile.user.rep?
- image_tag("user190x119.jpg", html)
- else
- image_tag("user#{size}.jpg", html)
- end
+ return link_to(image_tag("user190x119.jpg", html), profile_path(profile) ) if is_user_rep?(profile)
+ return link_to(image_tag("user#{size}.jpg", html), profile_path(profile) )
+ else # The code below is not being used in spec
+ image_tag("user190x119.jpg", html) if is_user_rep?(profile)
+ image_tag("user#{size}.jpg", html)
end
end
-end
\ No newline at end of file
+end
diff --git a/refactor-this/helper_spec.rb b/refactor-this/helper_spec.rb
index b82e40e..64a4646 100644
--- a/refactor-this/helper_spec.rb
+++ b/refactor-this/helper_spec.rb
@@ -12,14 +12,22 @@
describe "Helper" do
before(:each) do
@helper = Helper.new
+ @helper.stub!(:profile_path).and_return("profile_path")
+ @helper.stub!(:url_for_file_column).and_return("file_column_url")
+ @helper.stub!(:set_image_default_html).and_return({})
end
describe "display_photo" do
+ before do
+ @helper.stub!(:image_tag).and_return("wrench.png")
+ end
it "should return the wrench if there is no profile" do
@helper.display_photo(nil, "100x100", {}, {}, true).should == "wrench.png"
end
describe "With a profile, user and photo requesting a link" do
before(:each) do
+ @helper.stub!(:image_tag).and_return("")
+ @helper.stub_chain(:link_to).and_return("this link")
@profile = UserProfile.new
@profile.name = "Clayton"
@user = User.new
@@ -35,6 +43,7 @@
describe "With a profile, user and photo not requesting a link" do
before(:each) do
+ @helper.stub!(:image_tag).and_return("just image")
@profile = UserProfile.new
@profile.name = "Clayton"
@user = User.new
@@ -50,6 +59,8 @@
describe "Without a user, but requesting a link" do
before(:each) do
+ @helper.stub!(:image_tag).and_return("")
+ @helper.stub!(:link_to).and_return("default link 100x100")
@profile = UserProfile.new
@profile.name = "Clayton"
end
@@ -68,6 +79,8 @@
end
describe "With a rep user" do
before(:each) do
+ @helper.stub!(:image_tag).and_return("")
+ @helper.stub!(:link_to).and_return("default link 190x119")
@user.stub!(:rep?).and_return(true)
end
it "return a default link" do
@@ -78,6 +91,8 @@
describe "With a regular user" do
before(:each) do
+ @helper.stub!(:image_tag).and_return("")
+ @helper.stub!(:link_to).and_return("default link 100x100")
@user.stub!(:rep?).and_return(false)
end
it "return a default link" do
@@ -106,6 +121,8 @@
describe "With a regular user" do
before(:each) do
+ @helper.stub!(:image_tag).and_return("")
+ @helper.stub!(:link_to).and_return("default link 100x100")
@user.stub!(:rep?).and_return(false)
end
it "return a default link" do
@@ -116,4 +133,4 @@
end
-end
\ No newline at end of file
+end
diff --git a/refactor-this/profile.rb b/refactor-this/profile.rb.not_used
similarity index 100%
rename from refactor-this/profile.rb
rename to refactor-this/profile.rb.not_used
diff --git a/refactor-this/user.rb b/refactor-this/user.rb
index 3903564..3c92c48 100644
--- a/refactor-this/user.rb
+++ b/refactor-this/user.rb
@@ -1,7 +1,4 @@
class User
attr_accessor :name, :email, :photo
- def hello_from
- "Hey it's #{name}"
- end
end
\ No newline at end of file
diff --git a/resume/David_Ebel-Resume.pdf b/resume/David_Ebel-Resume.pdf
new file mode 100644
index 0000000..01c9063
Binary files /dev/null and b/resume/David_Ebel-Resume.pdf differ