Skip to content

Commit

Permalink
update license and web urls
Browse files Browse the repository at this point in the history
- manually set license for jboss-as repository to LGPL
- use license key on module index page
- change http_url to html_url
- add html_url key to component
- include relative path in web url on module page if applicable
- add flag for external repository
  • Loading branch information
mojavelinux committed Oct 22, 2012
1 parent 1a23ff4 commit a93bdfb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
10 changes: 6 additions & 4 deletions _ext/arquillian.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def self.resolve_contributors_between(site, repository, sha1, sha2)
:repositories => []
})
site.git_author_index[e.email].commits += e.commits
site.git_author_index[e.email].repositories |= [repository.http_url]
site.git_author_index[e.email].repositories |= [repository.html_url]
end
e.delete_field('sha')
}.sort {|a, b| a.name <=> b.name}
Expand All @@ -146,7 +146,7 @@ def self.resolve_commits_between(repository, sha1, sha2)
end

def self.build_commit_url(repository, sha, ext)
repository.http_url + '/commit/' + sha + '.' + ext
repository.html_url + '/commit/' + sha + '.' + ext
end
end

Expand Down Expand Up @@ -204,13 +204,15 @@ def visit(repository, site)
:basepath => repository.path.eql?(repository.owner) ? repository.path : repository.path.sub(/^#{repository.owner}-/, ''),
:key => repository.path.split('-').last, # this is how components are matched in jira
:owner => repository.owner,
:html_url => repository.relative_path.empty? ? repository.html_url : "#{repository.html_url}/tree/#{repository.master_branch}/#{repository.relative_path.chomp('/')}",
:external => !repository.owner.eql?('arquillian'),
:name => resolve_name(repository),
:desc => repository.desc,
:groupId => resolve_group_id(repository),
:parent => true,
:lead => resolve_current_lead(repository, site.component_leads),
# what about the AS7 adapters? are those ASL?
:license => 'Apache License 2.0',
# we should not assume the license for external modules
:license => repository.owner.eql?('jbossas') ? 'LGPL v2.1' : 'ASL v2.0',
:releases => [],
:contributors => []
})
Expand Down
11 changes: 5 additions & 6 deletions _ext/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ def execute(site)
:owner => git_url.split('/').last(2).first,
:host => URI(git_url).host,
:type => 'git',
# QUESTION should this be html_url??
:http_url => git_url.chomp('.git').sub('git://', 'https://'),
:html_url => git_url.chomp('.git').sub('git://', 'https://'),
:clone_url => git_url
})
@repositories << repository
Expand All @@ -78,7 +77,7 @@ def execute(site)
:owner => 'jbossas',
:host => 'github.com',
:type => 'git',
:http_url => 'https://github.com/jbossas/jboss-as',
:html_url => 'https://github.com/jbossas/jboss-as',
:clone_url => 'git://github.com/jbossas/jboss-as.git'
)

Expand All @@ -90,7 +89,7 @@ def execute(site)
# :owner => 'apache',
# :host => 'github.com',
# :type => 'git',
# :http_url => 'https://github.com/apache/openejb',
# :html_url => 'https://github.com/apache/openejb',
# :clone_url => 'git://github.com/apache/openejb.git'
#)

Expand All @@ -101,7 +100,7 @@ def execute(site)
:owner => 'jsfunit',
:host => 'github.com',
:type => 'git',
:http_url => 'https://github.com/jsfunit/jsfunit',
:html_url => 'https://github.com/jsfunit/jsfunit',
:clone_url => 'git://github.com/jsfunit/jsfunit.git'
)

Expand All @@ -112,7 +111,7 @@ def execute(site)
:owner => 'forge',
:host => 'github.com',
:type => 'git',
:http_url => 'https://github.com/forge/plugin-arquillian',
:html_url => 'https://github.com/forge/plugin-arquillian',
:clone_url => 'git://github.com/forge/plugin-arquillian.git'
)

Expand Down
6 changes: 4 additions & 2 deletions _layouts/module.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ layout: default
%li
%i.icon-leaf
License:
%strong ASL v2.0
%strong= page.component.license
.row
.span3
%h3
Expand Down Expand Up @@ -67,10 +67,12 @@ layout: default
%dd= page.component.repository.host
%dt Organization
%dd
-# make function for organization url or add to data structure
%a{:href=>"http://#{page.component.repository.host}/#{page.component.repository.owner}"}= page.component.repository.owner
%dt Web URL
%dd
%a{:href=>page.component.repository.http_url}= page.component.repository.path
- # make a function for full path (path + relative_path) or add to data structure
%a{:href=>page.component.html_url}= page.component.repository.relative_path.empty? ? page.component.repository.path : "#{page.component.repository.path}/#{page.component.repository.relative_path.chomp('/')}"
%dt Clone URL
%dd
%a{:href=>page.component.repository.clone_url}= page.component.repository.path + '.' + page.component.repository.type
Expand Down
2 changes: 1 addition & 1 deletion modules/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ title: Modules
&nbsp;
- else !mod.component.releases.empty?
%span.muted= " &#8211; #{mod.component.releases.last.version}"
- if !mod.component.owner.eql? 'arquillian'
- if mod.component.external
%span.label External
- prev_vendor = mod.vendor

0 comments on commit a93bdfb

Please sign in to comment.