Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 9 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 25 additions and 19 deletions.
  1. +12 −11 _ext/guide.rb
  2. +1 −1  _ext/identities/gravatar.rb
  3. +12 −7 setup.sh
View
23 _ext/guide.rb
@@ -49,7 +49,7 @@ def execute(site)
# FIXME contributors should be listed somewhere on the page, but not automatically authors
# perhaps as little pictures like on github
- guide.changes = page_changes(page, @num_changes)
+ guide.changes = page_changes(page, site, @num_changes)
# NOTE page.content forces the source path to be rendered
page_content = Nokogiri::HTML(page.content)
@@ -118,7 +118,7 @@ def execute(site)
end
# Add the Contributors to Guide based on Git Commit history
- guide.contributors = page_contributors(page, @num_contrib_changes, guide.authors)
+ guide.contributors = page_contributors(page, site, @num_contrib_changes, guide.authors)
class << page
def render(context)
@@ -202,10 +202,10 @@ def findLanguages(page)
# Assumes guides are brought in as submodules so opens git rooted in the page's dir
# The Array is ordered by number of commits done by the contributors.
# Any authors are removed from the contributor list
- def page_contributors(page, size, authors)
+ def page_contributors(page, site, size, authors)
contributors = Hash.new
- page_dir = page.site.dir.match(/^(.*)(\/)$/)[1] + @path_prefix
- rpath = page.source_path.match(/(#{page_dir})\/(.+)/)[2]
+ page_dir = site.dir.to_s.match(/^(.*)([\/]?)$/)[1] + @path_prefix
+ rpath = page.source_path.to_s.match(/(#{page_dir})\/(.+)/)[2]
g = Git.open(page_dir)
g.log(size == -1 ? nil : size).path(rpath).each do |c|
if !authors || authors.count(c.author.name) == 0
@@ -219,18 +219,19 @@ def page_contributors(page, size, authors)
contributors.size == 0 ? nil : contributors.sort{|a, b| b[1] <=> a[1]}.map{|x| x[0]}
end
- def guide_repo(page)
+ def guide_repo(page, site)
changes = []
- page_dir = page.site.dir.match(/^(.*)(\/)$/)[1] + @path_prefix
- rpath = page.source_path.match(/(#{page_dir})\/(.+)/)[2]
+ page_dir = site.dir.to_s.match(/^(.*)([\/]?)$/)[1] + @path_prefix
+ rpath = page.source_path.to_s.match(/(#{page_dir})\/(.+)/)[2]
Git.open(page_dir).config('remote.origin.url')
end
- def page_changes(page, size)
+ def page_changes(page, site, size)
changes = []
- page_dir = page.site.dir.match(/^(.*)(\/)$/)[1] + @path_prefix
- rpath = page.source_path.match(/(#{page_dir})\/(.+)/)[2]
+ puts site.dir
+ page_dir = site.dir.to_s.match(/^(.*)([\/]?)$/)[1] + @path_prefix
+ rpath = page.source_path.to_s.match(/(#{page_dir})\/(.+)/)[2]
g = Git.open(page_dir)
g.log(size == -1 ? nil : size).path(rpath).each do |c|
changes << Change.new(c.sha, c.author.name, c.author.date, c.message.split(/\n/)[0].chomp('.').capitalize)
View
2  _ext/identities/gravatar.rb
@@ -16,7 +16,7 @@ def crawl(identity)
hash = Digest::MD5.new().update(identity.email.downcase).hexdigest
end
url = API_URL_TEMPLATE % hash
- response = RestClient.get(url) do |rsp, req, res, &blk|
+ response = RestClient.get(url, :user_agent => "rest-client") do |rsp, req, res, &blk|
if rsp.code.eql? 404
rsp = RestClient::Response.create('{}', rsp.net_http_res, rsp.args)
rsp.instance_variable_set(:@code, 200)
View
19 setup.sh
@@ -23,17 +23,21 @@ if [ -z "$ASCIIDOC_HOME" ]; then
ASCIIDOC_HOME="$DIR/_tmp/asciidoc_home"
fi
-function command_exists {
- command -v $1 >/dev/null 2>&1 || { echo "I $1 require but it's not installed. Aborting." >&2; exit 1; }
+command_exists () {
+ type "$1" &> /dev/null ;
}
-echo "**** Testing environment"
-
-command_exists tar
-command_exists curl
+function require_command {
+ command -v $1 >/dev/null 2>&1 || { echo "I require $1 but it's not installed. Aborting." >&2; exit 1; }
+}
echo "**** Setting up necessary Gems, Eggs and [RPMs|Mac Ports] for the jdf site"
+echo "*** Testing environment"
+
+require_command tar
+require_command curl
+
echo "*** Gems"
g=${#GEMS[@]}
@@ -52,7 +56,8 @@ done
if ! command_exists "pip"
then
- $SUDO $EASY_INSTALL --upgrade $EASY_INSTALL_OPTIONS "pip"
+ echo "*** Setting up pip, the more modern Python egg installer"
+ $SUDO $EASY_INSTALL $EASY_INSTALL_OPTIONS pip
fi
installed_eggs=`pip freeze`

No commit comments for this range

Something went wrong with that request. Please try again.