rubycat 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c35c45b7f7cf2bf154d36e8d69f09d849cf5523
4
- data.tar.gz: 3fcb742540d0c586a9d7d9165bbbea5bfd3175ab
3
+ metadata.gz: 5f74c79895ee48e5b1e1cfb023028b2ec00fdd19
4
+ data.tar.gz: a9c8709bfb94a8fad89e2cdb2a882c1e5246b44b
5
5
  SHA512:
6
- metadata.gz: ed46c3db1204955c6a2343ea4ec97cf2556ce3ce08771c3208b7a3ff81640f100ce39f1810ecf7c138258f4ecf76d4a917eca6fe185c0acc9a27860d50216d3c
7
- data.tar.gz: ba67a2270d48d9dad5dcee503f3861f2fbf1ce6e648f0ed192e03d9dfd4cd97bc6ee1124ba7d630e4ae93aad218e56fa129ad289d9d0ad9b68bf9e40fc47e1dd
6
+ metadata.gz: c1684e88af7af86212fc31e5b681aa9c1d84b2440de20f4141d0b8c01d91b0055ff238d5ad59abcc17e79dcfac437be3e5eabc9fb06ac909666e5d033c682d0e
7
+ data.tar.gz: f984352a7b026c94904986571e1eb3dbd55b700d4f78b70f1e9b7bd56b6f416190719ee2974ed6dc5ab0ab4d0a7cbcb68ed534bd4732eaa5fcffb11cee27c490
data/.gemtest ADDED
File without changes
data/Manifest.txt CHANGED
@@ -3,4 +3,10 @@ Manifest.txt
3
3
  README.md
4
4
  Rakefile
5
5
  lib/rubycat.rb
6
+ lib/rubycat/card.rb
7
+ lib/rubycat/catalog.rb
6
8
  lib/rubycat/version.rb
9
+ test/data/RUBY.md
10
+ test/helper.rb
11
+ test/test_reader.rb
12
+ test/test_version.rb
data/Rakefile CHANGED
@@ -18,7 +18,7 @@ Hoe.spec 'rubycat' do
18
18
  self.history_file = 'HISTORY.md'
19
19
 
20
20
  self.extra_deps = [
21
- ['catalogdb', '>= 0.1.0'],
21
+ ['catalogdb', '>= 0.1.1'],
22
22
  ## 3rd party
23
23
  ['fetcher', '>= 0.4.5'],
24
24
  ['sqlite3']
@@ -0,0 +1,60 @@
1
+ # encoding: utf-8
2
+
3
+ module RubyCat
4
+
5
+
6
+ class Card
7
+
8
+ attr_reader :name # e.g. sinatra
9
+ attr_reader :gem_url # e.g. https://rubygems.org/gems/sinatra
10
+ attr_reader :github_url # e.g. https://github.com/sinatra/sinatra
11
+ attr_reader :categories # e.g.
12
+
13
+
14
+ def initialize( card )
15
+ @categories = card.categories
16
+ @name = nil
17
+
18
+ ## todo/fix: lotus/lotusrb - fix: make gem name higher priority
19
+ ## for now uses github name
20
+ ## also check/fallback to rubygems name (if no github entry)
21
+
22
+ github_link = card.links.find {|it| it[0].include?( ':octocat:') }
23
+
24
+ if github_link
25
+ @github_url = github_link[1]
26
+
27
+ ## check if org (shortcut)
28
+ uri = URI.parse( @github_url )
29
+ puts " uri.path: #{uri.path}"
30
+ ##
31
+ names = uri.path[1..-1].split('/') ## cut off leading / and split
32
+ pp names
33
+
34
+ ## if single name (duplicate - downcased! e.g. Ramaze => Ramaze/ramaze)
35
+ if names.size == 1
36
+ @github_url += "/#{names[0].downcase}"
37
+ @name = names[0].downcase
38
+ else
39
+ @name = names[1]
40
+ end
41
+ puts "github_url: #{@github_url}"
42
+ else
43
+ puts "*** no github_url found"
44
+ pp card
45
+ end
46
+
47
+ gem_link = card.links.find {|it| it[0] == ':gem:' }
48
+ if gem_link
49
+ @gem_url = gem_link[1]
50
+ puts "gem_url: #{@gem_url}"
51
+ else
52
+ puts "*** no gem_url found"
53
+ pp card
54
+ end
55
+ end
56
+ end ## class Card
57
+
58
+
59
+
60
+ end # module RubyCat
@@ -0,0 +1,40 @@
1
+ # encoding: utf-8
2
+
3
+ module RubyCat
4
+
5
+
6
+ class Catalog
7
+
8
+ def initialize
9
+ @cards = []
10
+ end
11
+
12
+ def add( cards )
13
+ @cards += cards.map { |card| Card.new(card) } ## convert to RubyCat card
14
+ end
15
+
16
+ def render
17
+ ## render to json
18
+ puts "--snip--"
19
+
20
+ ary = []
21
+
22
+ @cards.each do |card|
23
+ h = {
24
+ name: card.name,
25
+ gem_url: card.gem_url,
26
+ github_url: card.github_url,
27
+ categories: card.categories
28
+ }
29
+ pp h
30
+ ary << h
31
+ end
32
+
33
+ puts "--snip--"
34
+ puts JSON.pretty_generate( ary )
35
+ end
36
+
37
+ end ## class Catalog
38
+
39
+
40
+ end # module RubyCat
@@ -3,8 +3,8 @@
3
3
  module RubyCat
4
4
 
5
5
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
6
- MINOR = 0
7
- PATCH = 1
6
+ MINOR = 1
7
+ PATCH = 0
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
data/lib/rubycat.rb CHANGED
@@ -9,6 +9,8 @@ require 'fetcher'
9
9
 
10
10
  require 'rubycat/version' ## let version always go first
11
11
 
12
+ require 'rubycat/card'
13
+ require 'rubycat/catalog'
12
14
 
13
15
 
14
16
  # say hello
data/test/data/RUBY.md ADDED
@@ -0,0 +1,157 @@
1
+ Awesome Series @ Planet Ruby
2
+
3
+ [Rubies (Virtual Machines, Compilers, ...)](https://github.com/planetruby/awesome-rubies) •
4
+ [ActiveRecord](https://github.com/planetruby/awesome-activerecord) •
5
+ [Webframeworks (Micro, Macro, APIs, ...)](https://github.com/planetruby/awesome-webframeworks) •
6
+ [Static Generators (Sites, Books, Presentations, ...)](https://github.com/planetruby/awesome-staticgen) •
7
+ [Events (Conferences, Camps, Meetups, ...)](https://github.com/planetruby/awesome-events) •
8
+ [Blogs (News, Opinions, Podcasts, ...)](https://github.com/planetruby/awesome-blogs)
9
+
10
+
11
+ # Webframeworks
12
+
13
+ A collection of awesome Ruby web frameworks, libraries, tools, etc.
14
+
15
+
16
+ Note: :gem: stands for the RubyGems page, :octocat: stands for the GitHub page and :book: stands for the RubyDoc page.
17
+
18
+ ---
19
+
20
+ [ANNOUNCEMENT] Looking for awesome Ruby Gems? See the [Ruby Gems of the Week Series @ Planet Ruby](http://planetruby.github.io/gems).
21
+
22
+ ---
23
+
24
+ Contributions welcome. Anything missing? Send in a pull request. Thanks.
25
+
26
+
27
+ [Rack](#rack) •
28
+ [Rack Alternatives](#rack-alternatives) •
29
+ [Ruby on Rails](#ruby-on-rails) •
30
+ [Sinatra](#sinatra) •
31
+ [Volt](#volt) •
32
+ [Async Web (Socket) Frameworks](#async-web-socket-frameworks) •
33
+ [Web Service Frameworks](#web-service-frameworks) •
34
+ [Micro Framework Alternatives](#micro-framework-alternatives) •
35
+ ["Full Stack" Macro Framework Alternatives](#full-stack-macro-framework-alternatives) •
36
+ [Meta](#meta)
37
+
38
+
39
+ ## Rack
40
+
41
+ - [Rack HQ](http://rack.github.io) - [:octocat:](https://github.com/rack), [:gem:](https://rubygems.org/gems/rack), [:book:](http://rubydoc.info/gems/rack)
42
+
43
+ ## Rack Alternatives
44
+
45
+ - [the_metal :octocat:](https://github.com/tenderlove/the_metal) - a spike for thoughts about Rack 2.0
46
+
47
+ ## Ruby on Rails
48
+
49
+ _Batteries Included "Full Stack" Macro Framework_
50
+
51
+ - [Ruby on Rails HQ](http://rubyonrails.org) - [:octocat:](https://github.com/rails), [:gem:](https://rubygems.org/gems/rails), [:book:](http://rubydoc.info/gems/rails)
52
+ - [News & Updates](http://weblog.rubyonrails.org)
53
+
54
+ Extensions:
55
+
56
+ - [Hobo HQ](http://hobocentral.net) - [:octocat:](https://github.com/Hobo), [:gem:](https://rubygems.org/gems/hobo), [:book:](http://rubydoc.info/gems/hobo)
57
+ - [News & Updates](http://hobocentral.net/blog)
58
+
59
+ Future:
60
+
61
+ - [Trailblazer](http://trailblazerb.org), [:octocat:](https://github.com/apotonick/trailblazer), [:gem:](https://rubygems.org/gems/trailblazer), [:book:](http://rubydoc.info/gems/trailblazer) - a thin layer on top of rails - (gently) enforces encapsulation, a "more" intuitive code structure and giving you a "better" object-oriented architecture by Nick Sutterer et al
62
+
63
+
64
+
65
+ ## Sinatra
66
+
67
+ _Micro Framework_
68
+
69
+ - [Sinatra HQ](http://sinatrarb.com) - [:octocat:](https://github.com/sinatra), [:gem:](https://rubygems.org/gems/sinatra), [:book:](http://rubydoc.info/gems/sinatra)
70
+
71
+ Extensions:
72
+
73
+ - [Padrino HQ](http://padrinorb.com) - [:octocat:](https://github.com/padrino), [:gem:](https://rubygems.org/gems/padrino), [:book:](http://rubydoc.info/gems/padrino)
74
+ - [News & Updates](http://www.padrinorb.com/blog)
75
+
76
+ Fun / Hack:
77
+
78
+ - [Almost Sinatra :octocat:](https://github.com/rkh/almost-sinatra) - Sinatra refactored, only six lines of code by Konstantin Haase
79
+
80
+ Future:
81
+
82
+ - [Mustermann](http://rkh.github.io/mustermann), [:octocat:](https://github.com/rkh/mustermann) - your personal string matching expert; can be used as a plugin for Sinatra 1.x and will power Sinatra 2.0; by Konstantin Haase et al
83
+
84
+
85
+ ## Volt
86
+
87
+ _Client/Server Isomorphic Framework_
88
+
89
+ - [Volt HQ](http://voltframework.com) - [:octocat:](https://github.com/voltrb), [:gem:](https://rubygems.org/gems/volt), [:book:](http://rubydoc.info/gems/volt)
90
+ - [News & Updates](http://voltframework.com/blog)
91
+
92
+ ## Async Web (Socket) Frameworks
93
+
94
+ - [Cramp :octocat:](https://github.com/lifo/cramp), [:gem:](https://rubygems.org/gems/cramp) - a fully asynchronous realtime web application framework built on top of event machine; providing full-duplex bi-directional communication by Pratik Naik
95
+
96
+ - [Lattice :octocat:](https://github.com/celluloid/lattice), [:gem:](https://rubygems.org/gems/lattice), [:book:](http://rubydoc.info/gems/lattice) - an actor-based web framework built on top of celluloid, reel, and webmachine; designed for realtime apps, end-to-end streaming, and websockets by Tony Arcieri et al
97
+
98
+
99
+
100
+ ## Web Service Frameworks
101
+
102
+ _JSON HTTP API Builder_
103
+
104
+ - [Grape](http://intridea.github.io/grape) - [:octocat:](https://github.com/intridea/grape), [:gem:](https://rubygems.org/gems/grape), [:book:](http://rubydoc.info/gems/grape) - a micro-framework for creating REST-like APIs
105
+ - [Crêpe :octocat:](https://github.com/crepe) - [:gem:](https://rubygems.org/gems/crepe) - a thin API stack
106
+ - [Yaks :octocat:](https://github.com/plexus/yaks) - [:gem:](https://rubygems.org/gems/yaks), [:book:](http://rubydoc.info/gems/yaks) - serialize to hypermedia. HAL, JSON API, HALO, collection+JSON etc. by Arne Brasseur et al
107
+ - [Praxis](http://praxis-framework.io) - [:octocat:](https://github.com/rightscale/praxis), [:gem:](https://rubygems.org/gems/praxis), [:book:](http://rubydoc.info/gems/praxis) - a micro framework focusing on the design and coding aspects of creating good APIs quick by Josep M. Blanquer et al
108
+
109
+ ## Micro Framework Alternatives
110
+
111
+ - [Rum :octocat:](https://github.com/chneukirchen/rum) - gRand Unified Mapper for rack apps by Christian Neukirchen
112
+ - [Cuba](http://cuba.is) - [:octocat:](https://github.com/soveran/cuba), [:gem:](https://rubygems.org/gems/cuba), [:book:](http://rubydoc.info/gems/cuba) - tiny but powerful mapper for rack apps by Michel Martens
113
+ - [New York, New York (NYNY)](http://alisnic.github.io/nyny) - [:octocat:](https://github.com/alisnic/nyny), [:gem:](https://rubygems.org/gems/nyny), [:book:](http://rubydoc.info/gems/nyny) - a tiny (~300 lines of code) web framework on top of rack by Andrei Lisnic
114
+ - [Roda](http://roda.jeremyevans.net) - [:octocat:](https://github.com/jeremyevans/roda), [:gem:](https://rubygems.org/gems/roda), [:book:](http://rubydoc.info/gems/roda) - a routing tree web framework toolkit by Jeremy Evans
115
+ - [Hobbit :octocat:](https://github.com/patriciomacadden/hobbit), [:gem:](https://rubygems.org/gems/hobbit), [:book:](http://rubydoc.info/gems/hobbit) - a minimalistic microframework built on top of rack by Patricio Mac Adden
116
+ - [Brooklyn :octocat:](https://github.com/luislavena/brooklyn) - a small web tool on top of rack by Luis Lavena
117
+ - [Nancy](http://guilleiguaran.github.io/nancy), [:octocat:](https://github.com/guilleiguaran/nancy), [:gem:](https://rubygems.org/gems/nancy), [:book:](http://rubydoc.info/gems/nancy) - Sinatra's little daughter by Guillermo Iguaran
118
+ - [Camping](http://camping.io), [:octocat:](https://github.com/camping), [:gem:](https://rubygems.org/gems/camping), [:book:](http://www.rubydoc.info/gems/camping) - minature rails for stay-at-home moms; the 4k pocket full-of-gags web microframework
119
+ - [Scorched](http://scorchedrb.com), [:octocat:](https://github.com/Wardrop/Scorched), [:gem:](https://rubygems.org/gems/scorched), [:book:](http://rubydoc.info/gems/scorched) - light-weight, DRY as a desert, web framework by Tom Wardrop et al
120
+
121
+
122
+ <!--
123
+ more
124
+ Kenji - https://github.com/kballenegger/kenji ??
125
+ -->
126
+
127
+
128
+
129
+ ## "Full Stack" Macro Framework Alternatives
130
+
131
+ - [Lotus HQ](http://lotusrb.org) - [:octocat:](https://github.com/lotus), [:gem:](https://rubygems.org/gems/lotusrb), [:book:](http://rubydoc.info/gems/lotusrb) - a complete web framework; bringing back object-oriented programming to web development, leveraging a stable API, minimal DSL and plain objects by Luca Guidi et al
132
+ - [News & Updates](http://lotusrb.org/blog)
133
+
134
+ <!-- new list -->
135
+
136
+ - [Pakyow HQ](http://pakyow.org) - [:octocat:](https://github.com/pakyow), [:gem:](https://rubygems.org/gems/pakyow) - an open-source framework for the modern web with a view-first development process that's friendly to everyone whether you're a designer or a developer
137
+ - [News & Updates](http://pakyow.org/blog)
138
+
139
+ <!-- new list -->
140
+
141
+ - [Ramaze HQ](http://ramaze.net) - [:octocat:](https://github.com/Ramaze), [:gem:](https://rubygems.org/gems/ramaze), [:book:](http://rubydoc.info/gems/ramaze) - a simple, light and modular open-source web application framework by Michael Fellinger et al
142
+ - [News & Updates](http://ramaze.net/blog)
143
+
144
+ ## Thanks
145
+
146
+ Josep M. Blanquer
147
+
148
+ ## Meta
149
+
150
+ **License**
151
+
152
+ The awesome list is dedicated to the public domain. Use it as you please with no restrictions whatsoever.
153
+
154
+ **Questions? Comments?**
155
+
156
+ Send them along to the ruby-talk mailing list. Thanks!
157
+
data/test/helper.rb ADDED
@@ -0,0 +1,9 @@
1
+ # encoding: utf-8
2
+
3
+
4
+ ## minitest setup
5
+ require 'minitest/autorun'
6
+
7
+ ## our own code
8
+ require 'rubycat'
9
+
@@ -0,0 +1,34 @@
1
+ # encoding: utf-8
2
+
3
+ ###
4
+ # to run use
5
+ # ruby -I ./lib -I ./test test/test_reader.rb
6
+
7
+
8
+ require 'helper'
9
+
10
+
11
+ class TestReader < MiniTest::Test
12
+
13
+ def test_ruby
14
+
15
+ r = CatalogDb::CardReader.from_file( "#{CatalogDb.root}/test/data/RUBY.md" )
16
+ cards = r.read
17
+
18
+ pp cards
19
+
20
+ c = cards[0]
21
+
22
+ assert_equal [["Rack HQ", "http://rack.github.io"],
23
+ [":octocat:", "https://github.com/rack"],
24
+ [":gem:", "https://rubygems.org/gems/rack"],
25
+ [":book:", "http://rubydoc.info/gems/rack"]], c.links
26
+
27
+ assert_equal 'Webframeworks › Rack', c.categories
28
+
29
+ cat = RubyCat::Catalog.new
30
+ cat.add( cards )
31
+ cat.render
32
+ end
33
+
34
+ end # class TestReader
@@ -0,0 +1,18 @@
1
+ # encoding: utf-8
2
+
3
+ ###
4
+ # to run use
5
+ # ruby -I ./lib -I ./test test/test_version.rb
6
+
7
+
8
+ require 'helper'
9
+
10
+ class TestVersion < MiniTest::Test
11
+
12
+ def test_version
13
+ assert_equal RubyCat::VERSION, RubyCat.version
14
+ assert true # if we get here - test success
15
+ end
16
+
17
+
18
+ end # class TestVersion
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubycat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.0
19
+ version: 0.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.0
26
+ version: 0.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: fetcher
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -90,12 +90,19 @@ extra_rdoc_files:
90
90
  - Manifest.txt
91
91
  - README.md
92
92
  files:
93
+ - ".gemtest"
93
94
  - HISTORY.md
94
95
  - Manifest.txt
95
96
  - README.md
96
97
  - Rakefile
97
98
  - lib/rubycat.rb
99
+ - lib/rubycat/card.rb
100
+ - lib/rubycat/catalog.rb
98
101
  - lib/rubycat/version.rb
102
+ - test/data/RUBY.md
103
+ - test/helper.rb
104
+ - test/test_reader.rb
105
+ - test/test_version.rb
99
106
  homepage: https://github.com/textkit/rubycat
100
107
  licenses:
101
108
  - Public Domain
@@ -123,4 +130,6 @@ signing_key:
123
130
  specification_version: 4
124
131
  summary: rubycat - ruby (library) catalog (cards) command line tool (using the catalog.db
125
132
  machinery)
126
- test_files: []
133
+ test_files:
134
+ - test/test_version.rb
135
+ - test/test_reader.rb