github-widget 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. data/.gitignore +1 -0
  2. data/README.md +92 -0
  3. data/app/assets/images/github-widget/public.png +0 -0
  4. data/app/assets/images/github-widget/public_fork.png +0 -0
  5. data/app/assets/images/github-widget/repostat_forks.png +0 -0
  6. data/app/assets/images/github-widget/repostat_watchers.png +0 -0
  7. data/app/assets/javascripts/github-widget/projects.js.coffee +16 -0
  8. data/app/assets/stylesheets/github-widget/projects.css.sass.erb +95 -0
  9. data/app/views/github-widget/_projects.hbs +38 -0
  10. data/develop-example/.gitignore +5 -0
  11. data/develop-example/Gemfile +44 -0
  12. data/develop-example/Gemfile.lock +139 -0
  13. data/develop-example/README +261 -0
  14. data/develop-example/Rakefile +7 -0
  15. data/develop-example/app/assets/images/rails.png +0 -0
  16. data/develop-example/app/assets/javascripts/application.js +12 -0
  17. data/develop-example/app/assets/javascripts/github-widget/projects.js.coffee +16 -0
  18. data/develop-example/app/assets/javascripts/home.js.coffee +3 -0
  19. data/develop-example/app/assets/javascripts/plugins.js.coffee +20 -0
  20. data/develop-example/app/assets/stylesheets/application.css +292 -0
  21. data/develop-example/app/assets/stylesheets/home.css.scss +8 -0
  22. data/develop-example/app/controllers/application_controller.rb +3 -0
  23. data/develop-example/app/controllers/home_controller.rb +5 -0
  24. data/develop-example/app/helpers/application_helper.rb +2 -0
  25. data/develop-example/app/helpers/home_helper.rb +2 -0
  26. data/develop-example/app/mailers/.gitkeep +0 -0
  27. data/develop-example/app/models/.gitkeep +0 -0
  28. data/develop-example/app/views/github_widget/_projects.hbs +38 -0
  29. data/develop-example/app/views/home/index.html.erb +0 -0
  30. data/develop-example/app/views/layouts/application.html.erb +62 -0
  31. data/develop-example/config.ru +4 -0
  32. data/develop-example/config/application.rb +42 -0
  33. data/develop-example/config/boot.rb +6 -0
  34. data/develop-example/config/database.yml +25 -0
  35. data/develop-example/config/environment.rb +5 -0
  36. data/develop-example/config/environments/development.rb +27 -0
  37. data/develop-example/config/environments/production.rb +54 -0
  38. data/develop-example/config/environments/test.rb +39 -0
  39. data/develop-example/config/initializers/backtrace_silencers.rb +7 -0
  40. data/develop-example/config/initializers/inflections.rb +10 -0
  41. data/develop-example/config/initializers/mime_types.rb +5 -0
  42. data/develop-example/config/initializers/secret_token.rb +7 -0
  43. data/develop-example/config/initializers/session_store.rb +8 -0
  44. data/develop-example/config/initializers/wrap_parameters.rb +12 -0
  45. data/develop-example/config/locales/en.yml +5 -0
  46. data/develop-example/config/routes.rb +60 -0
  47. data/develop-example/db/seeds.rb +7 -0
  48. data/develop-example/doc/README_FOR_APP +2 -0
  49. data/develop-example/lib/tasks/.gitkeep +0 -0
  50. data/develop-example/log/.gitkeep +0 -0
  51. data/develop-example/public/.htaccess +522 -0
  52. data/develop-example/public/404.html +26 -0
  53. data/develop-example/public/422.html +26 -0
  54. data/develop-example/public/500.html +26 -0
  55. data/develop-example/public/apple-touch-icon-114x114-precomposed.png +0 -0
  56. data/develop-example/public/apple-touch-icon-57x57-precomposed.png +0 -0
  57. data/develop-example/public/apple-touch-icon-72x72-precomposed.png +0 -0
  58. data/develop-example/public/apple-touch-icon-precomposed.png +0 -0
  59. data/develop-example/public/apple-touch-icon.png +0 -0
  60. data/develop-example/public/crossdomain.xml +25 -0
  61. data/develop-example/public/favicon.ico +0 -0
  62. data/develop-example/public/humans.txt +43 -0
  63. data/develop-example/public/robots.txt +5 -0
  64. data/develop-example/script/rails +6 -0
  65. data/develop-example/test/fixtures/.gitkeep +0 -0
  66. data/develop-example/test/functional/.gitkeep +0 -0
  67. data/develop-example/test/functional/home_controller_test.rb +9 -0
  68. data/develop-example/test/integration/.gitkeep +0 -0
  69. data/develop-example/test/performance/browsing_test.rb +12 -0
  70. data/develop-example/test/test_helper.rb +13 -0
  71. data/develop-example/test/unit/.gitkeep +0 -0
  72. data/develop-example/test/unit/helpers/home_helper_test.rb +4 -0
  73. data/develop-example/vendor/assets/stylesheets/.gitkeep +0 -0
  74. data/develop-example/vendor/plugins/.gitkeep +0 -0
  75. data/github-widget.gemspec +21 -0
  76. data/lib/generators/github_widget/USAGE +11 -0
  77. data/lib/generators/github_widget/github_widget_generator.rb +10 -0
  78. data/lib/github-widget.rb +4 -0
  79. data/lib/github-widget/version.rb +9 -0
  80. data/snapshot.png +0 -0
  81. metadata +135 -0
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ /develop
data/README.md ADDED
@@ -0,0 +1,92 @@
1
+ github-widget, a client-side, complete Github Widget.
2
+ ====================================================
3
+
4
+ Overview
5
+ --------
6
+
7
+ a widget provides your repositores, activities, .. current only repositores part is implemented. for activities, see [github-timelime-widget](https://github.com/alindeman/github-timeline-widget)
8
+
9
+ **Live Demo** [github-widget.heroku.com](http://github-widget.heroku.com)
10
+
11
+ ![screenshot](https://github.com/GutenYe/github-widget/raw/master/snapshot.png)
12
+
13
+ Dependency
14
+ ----------
15
+
16
+ * Rails3.1
17
+ * SproutCore 2.0
18
+ * HTML5
19
+ * Coffescript
20
+ * Sass
21
+
22
+
23
+ INSTALL & USAGE
24
+ ---------------
25
+
26
+ (optional) use a HTML5 boilerplate
27
+
28
+ rails new foo --template https://github.com/russfrisch/h5bp-rails/raw/master/h5bp.rb
29
+
30
+ in Gemfile
31
+
32
+ gem 'sproutcore-rails', :git => 'git://github.com/GutenYe/sproutcore-rails.git'
33
+ gem 'github-api-rails', :git => 'git://github.com/GutenYe/github-api.git', :branch => 'rails'
34
+ gem 'github-widget'
35
+
36
+ in app/assets/javascripts/application.js
37
+
38
+ //= require github-api
39
+ //= require sproutcore
40
+ //= require github-widget/projects
41
+
42
+ in app/assets/stylesheets/application.css
43
+
44
+ *= require github-widget/projects
45
+
46
+ in app/views/layouts/applictions.html.erb
47
+
48
+ <script>
49
+ window.github_username = 'gutenye';
50
+ </script>
51
+ <script type='text/html'>
52
+ <%= render 'github-widget/projects.hbs' %>
53
+ </script>
54
+ ...
55
+ <%= javascript_include_tag 'appliction' %>
56
+
57
+ Custom
58
+ ------
59
+
60
+ rails g github_widget
61
+
62
+ this will create a list of source code.
63
+
64
+ app/assets/javascripts/github-widget/projects.js.coffee
65
+ app/assets/stylesheets/github-widget/projects.css.sass.erb
66
+ ...
67
+
68
+
69
+ Contributing
70
+ -------------
71
+
72
+ Set up development environment
73
+
74
+ cp develop-example develop
75
+ cd develop # is a rails3.1 application
76
+ # develop and test
77
+
78
+ # it's import to symlink the outside file into rails project.
79
+ cd develop/app/assets/javascripts/github-widget
80
+ ln -s ../../../../../app/assets/javascripts/github-widget/projects.js.coffee
81
+
82
+
83
+ Resources
84
+ =========
85
+
86
+ * [github-timeline-widget](https://github.com/alindeman/github-timeline-widget) a Github widget that displays your GitHub activity.
87
+ * [github-api](https://github.com/fitzgen/github-api) Javascript bindings for the Github API.
88
+ * [coffee-script](https://github.com/jashkenas/coffee-script) Unfancy JavaScript.
89
+ * [sproutcore20](https://github.com/sproutcore/sproutcore20) JavaScript Application Framework.
90
+ * [sass](https://github.com/nex3/sass) Sass makes CSS fun again.
91
+ * [html5-boilerplate](https://github.com/paulirish/html5-boilerplate) starting html/css template. so much goodness baked in by default.
92
+
@@ -0,0 +1,16 @@
1
+ window.GithubWidget = SC.Application.create()
2
+
3
+ GithubWidget.projectsController = SC.ArrayProxy.create
4
+ content: []
5
+
6
+ window.github_username ?= 'gutenye'
7
+
8
+ user = gh.user(window.github_username)
9
+
10
+ user.allRepos (data) ->
11
+ GithubWidget.projectsController.set 'content',data.repositories
12
+
13
+ GithubWidget.ProjectView = SC.View.extend
14
+ public: ( ->
15
+ ! this.get('private')
16
+ ).property('private')
@@ -0,0 +1,95 @@
1
+ // core
2
+ #gh-widget-projects *
3
+ margin: 0
4
+ padding: 0
5
+
6
+ #gh-widget-projects a
7
+ color: #4183C4
8
+ text-decoration: none
9
+
10
+ #gh-widget-projects .group:before,
11
+ #gh-widget-projects .group:after
12
+ content: ""
13
+ display: table
14
+
15
+ #gh-widget-projects .group:after
16
+ clear: both
17
+
18
+ #gh-widget-projects .group
19
+ zoom: 1 // For IE 6/7 (trigger hasLayout)
20
+
21
+ // main
22
+ #gh-widget-projects
23
+ width: 400px
24
+
25
+ #gh-widget-projects .project
26
+ margin: 0 0 10px
27
+ padding: 8px 10px 0
28
+ border: 1px solid #DDDDDD
29
+ -moz-border-radius: 4px
30
+ -webkit-border-radius: 4px
31
+ border-radius: 4px
32
+
33
+ #gh-widget-projects .name
34
+ float: left
35
+
36
+ #gh-widget-projects .watchers span,
37
+ #gh-widget-projects .name span,
38
+ #gh-widget-projects .forks span
39
+ padding: 0 5px 0 23px
40
+
41
+ #gh-widget-projects .public
42
+ background: url("/assets/github-widget/public.png") no-repeat
43
+
44
+ #gh-widget-projects .public.fork
45
+ background-image: url("/assets/github-widget/public_fork.png")
46
+ height: 30px
47
+
48
+ #gh-widget-projects .forks
49
+ background: url("/assets/github-widget/repostat_forks.png") no-repeat
50
+
51
+ #gh-widget-projects .watchers
52
+ background: url("/assets/github-widget/repostat_watchers.png") no-repeat
53
+
54
+ #gh-widget-projects .repos-stats
55
+ font-size: 0.8em
56
+ float: right
57
+
58
+ #gh-widget-projects .repos-stats ul
59
+ list-style-type: none
60
+
61
+ #gh-widget-projects .repos-stats li
62
+ display: inline-block
63
+
64
+ #gh-widget-projects .repos-stats span
65
+ color: #666666
66
+ line-height: 20px
67
+
68
+ #gh-widget-projects .description
69
+ color: #444444
70
+ font-size: 0.9em
71
+ margin: 0 0 3px
72
+
73
+ #gh-widget-projects .updated-at
74
+ color: #888888
75
+ font-size: 0.8em
76
+
77
+ // body
78
+
79
+ #gh-widget-projects .body
80
+ width: 100%
81
+ margin-top: 8px
82
+ margin-left: -10px
83
+ padding: 5px 10px 5px 10px
84
+ border-top: 1px solid #EEE
85
+ background: -moz-linear-gradient(top,#FAFAFA,#EFEFEF)
86
+ background: #FAFAFA
87
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#FAFAFA',endColorstr='#EFEFEF')
88
+ background: -webkit-gradient(linear,left top,left bottom,from(#FAFAFA),to(#EFEFEF))
89
+ background: -moz-linear-gradient(top,#FAFAFA,#EFEFEF)
90
+ -webkit-border-bottom-right-radius: 4px
91
+ -webkit-border-bottom-left-radius: 4px
92
+ -moz-border-radius-bottomright: 4px
93
+ -moz-border-radius-bottomleft: 4px
94
+ border-bottom-right-radius: 4px
95
+ border-bottom-left-radius: 4px
@@ -0,0 +1,38 @@
1
+ <div id="gh-widget-projects">
2
+ {{#collection contentBinding="GithubWidget.projectsController"}}
3
+ {{#view GithubWidget.ProjectView tagName="section" class="project"
4
+ nameBinding="parentView.content.name"
5
+ descriptionBinding="parentView.content.description"
6
+ watchersBinding="parentView.content.watchers"
7
+ forksBinding="parentView.content.forks"
8
+ forkBinding="parentView.content.fork"
9
+ privateBinding="parentView.content.private"
10
+ languageBinding="parentView.content.language"
11
+ pushed_atBinding="parentView.content.pushed_at"
12
+ urlBinding="parentView.content.url" }}
13
+ <header class="group">
14
+ <h1 class="name" {{bindAttr class="fork public"}}>
15
+ <a {{bindAttr href="url"}}>{{name}}</a>
16
+ </h1>
17
+
18
+ <ul class="repos-stats">
19
+ <li>
20
+ {{language}}
21
+ </li>
22
+ <li class="watchers">
23
+ {{watchers}}
24
+ </li>
25
+ <li class="forks">
26
+ {{forks}}
27
+ </li>
28
+ </ul>
29
+ </header>
30
+
31
+ <div class="body">
32
+ <p class="description">{{description}}</p>
33
+ <p class="updated-at">Last updated {{pushed_at}}</p>
34
+ </div>
35
+ {{/view}}
36
+
37
+ {{/collection}}
38
+ </div>
@@ -0,0 +1,5 @@
1
+ .bundle
2
+ db/*.sqlite3
3
+ log/*.log
4
+ tmp/
5
+ .sass-cache/
@@ -0,0 +1,44 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '~> 3.1.0.rc'
4
+ gem 'sqlite3'
5
+
6
+ gem 'github-widget', :path => '../'
7
+ gem 'sproutcore-rails', :git => 'git://github.com/GutenYe/sproutcore-rails.git', :branch => 'source'
8
+ gem 'github-api-rails', :git => 'git://github.com/GutenYe/github-api.git', :branch => 'rails'
9
+
10
+ # Asset template engines
11
+ gem 'sass-rails', "~> 3.1.0.rc"
12
+ gem 'coffee-script'
13
+ gem 'uglifier'
14
+
15
+ # JavasScript libs
16
+ gem 'jquery-rails'
17
+ gem 'modernizr-rails'
18
+
19
+ # Stylesheet libs
20
+ # gem 'blueprint-rails'
21
+
22
+ # Ajax request CoffeeScript support
23
+ # gem 'coffeebeans'
24
+
25
+ # Heroku deployment requirements
26
+ # group :production do
27
+ # gem 'therubyracer-heroku'
28
+ # gem 'pg'
29
+ # end
30
+
31
+
32
+ # Use unicorn as the web server
33
+ # gem 'unicorn'
34
+
35
+ # Deploy with Capistrano
36
+ # gem 'capistrano'
37
+
38
+ # To use debugger
39
+ # gem 'ruby-debug19', :require => 'ruby-debug'
40
+
41
+ group :test do
42
+ # Pretty printed test output
43
+ gem 'turn', :require => false
44
+ end
@@ -0,0 +1,139 @@
1
+ GIT
2
+ remote: git://github.com/GutenYe/github-api.git
3
+ revision: 24198101281fa12348f70ce896d878fe1b8a3b81
4
+ branch: rails
5
+ specs:
6
+ github-api-rails (1.0.0)
7
+
8
+ GIT
9
+ remote: git://github.com/GutenYe/sproutcore-rails.git
10
+ revision: 4ad18a6c34d39d132bca2110eddd1281152af860
11
+ branch: source
12
+ specs:
13
+ sproutcore-rails (0.1.0)
14
+
15
+ PATH
16
+ remote: ../
17
+ specs:
18
+ github-widget (1.0.0)
19
+
20
+ GEM
21
+ remote: http://rubygems.org/
22
+ specs:
23
+ actionmailer (3.1.0.rc4)
24
+ actionpack (= 3.1.0.rc4)
25
+ mail (~> 2.3.0)
26
+ actionpack (3.1.0.rc4)
27
+ activemodel (= 3.1.0.rc4)
28
+ activesupport (= 3.1.0.rc4)
29
+ builder (~> 3.0.0)
30
+ erubis (~> 2.7.0)
31
+ i18n (~> 0.6)
32
+ rack (~> 1.3.0)
33
+ rack-cache (~> 1.0.1)
34
+ rack-mount (~> 0.8.1)
35
+ rack-test (~> 0.6.0)
36
+ sprockets (~> 2.0.0.beta.10)
37
+ tzinfo (~> 0.3.27)
38
+ activemodel (3.1.0.rc4)
39
+ activesupport (= 3.1.0.rc4)
40
+ bcrypt-ruby (~> 2.1.4)
41
+ builder (~> 3.0.0)
42
+ i18n (~> 0.6)
43
+ activerecord (3.1.0.rc4)
44
+ activemodel (= 3.1.0.rc4)
45
+ activesupport (= 3.1.0.rc4)
46
+ arel (~> 2.1.1)
47
+ tzinfo (~> 0.3.27)
48
+ activeresource (3.1.0.rc4)
49
+ activemodel (= 3.1.0.rc4)
50
+ activesupport (= 3.1.0.rc4)
51
+ activesupport (3.1.0.rc4)
52
+ multi_json (~> 1.0)
53
+ ansi (1.3.0)
54
+ arel (2.1.3)
55
+ bcrypt-ruby (2.1.4)
56
+ builder (3.0.0)
57
+ coffee-script (2.2.0)
58
+ coffee-script-source
59
+ execjs
60
+ coffee-script-source (1.1.1)
61
+ erubis (2.7.0)
62
+ execjs (1.2.0)
63
+ multi_json (~> 1.0)
64
+ hike (1.1.0)
65
+ i18n (0.6.0)
66
+ jquery-rails (1.0.12)
67
+ railties (~> 3.0)
68
+ thor (~> 0.14)
69
+ mail (2.3.0)
70
+ i18n (>= 0.4.0)
71
+ mime-types (~> 1.16)
72
+ treetop (~> 1.4.8)
73
+ mime-types (1.16)
74
+ modernizr-rails (2.0.6)
75
+ multi_json (1.0.3)
76
+ polyglot (0.3.1)
77
+ rack (1.3.0)
78
+ rack-cache (1.0.2)
79
+ rack (>= 0.4)
80
+ rack-mount (0.8.1)
81
+ rack (>= 1.0.0)
82
+ rack-ssl (1.3.2)
83
+ rack
84
+ rack-test (0.6.0)
85
+ rack (>= 1.0)
86
+ rails (3.1.0.rc4)
87
+ actionmailer (= 3.1.0.rc4)
88
+ actionpack (= 3.1.0.rc4)
89
+ activerecord (= 3.1.0.rc4)
90
+ activeresource (= 3.1.0.rc4)
91
+ activesupport (= 3.1.0.rc4)
92
+ bundler (~> 1.0)
93
+ railties (= 3.1.0.rc4)
94
+ railties (3.1.0.rc4)
95
+ actionpack (= 3.1.0.rc4)
96
+ activesupport (= 3.1.0.rc4)
97
+ rack-ssl (~> 1.3.2)
98
+ rake (>= 0.8.7)
99
+ rdoc (~> 3.4)
100
+ thor (~> 0.14.6)
101
+ rake (0.9.2)
102
+ rdoc (3.8)
103
+ sass (3.1.4)
104
+ sass-rails (3.1.0.rc.4)
105
+ actionpack (~> 3.1.0.rc1)
106
+ railties (~> 3.1.0.rc1)
107
+ sass (>= 3.1.4)
108
+ sprockets (>= 2.0.0.beta.9)
109
+ sprockets (2.0.0.beta.10)
110
+ hike (~> 1.0)
111
+ rack (~> 1.0)
112
+ tilt (!= 1.3.0, ~> 1.1)
113
+ sqlite3 (1.3.3)
114
+ thor (0.14.6)
115
+ tilt (1.3.2)
116
+ treetop (1.4.9)
117
+ polyglot (>= 0.3.1)
118
+ turn (0.8.2)
119
+ ansi (>= 1.2.2)
120
+ tzinfo (0.3.29)
121
+ uglifier (1.0.0)
122
+ execjs (>= 0.3.0)
123
+ multi_json (>= 1.0.2)
124
+
125
+ PLATFORMS
126
+ ruby
127
+
128
+ DEPENDENCIES
129
+ coffee-script
130
+ github-api-rails!
131
+ github-widget!
132
+ jquery-rails
133
+ modernizr-rails
134
+ rails (~> 3.1.0.rc)
135
+ sass-rails (~> 3.1.0.rc)
136
+ sproutcore-rails!
137
+ sqlite3
138
+ turn
139
+ uglifier