confluence 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/.document +5 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +29 -0
  4. data/Gemfile.lock +56 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.rdoc +19 -0
  7. data/Rakefile +45 -0
  8. data/VERSION +1 -0
  9. data/bin/confluence +5 -0
  10. data/lib/confluence.rb +25 -0
  11. data/lib/confluence/navigator.rb +67 -0
  12. data/lib/confluence/templates/%project_name%.cabal.tt +64 -0
  13. data/lib/confluence/templates/.document +5 -0
  14. data/lib/confluence/templates/.gitignore +61 -0
  15. data/lib/confluence/templates/.rspec +1 -0
  16. data/lib/confluence/templates/Gemfile.tt +20 -0
  17. data/lib/confluence/templates/LICENSE.txt.tt +20 -0
  18. data/lib/confluence/templates/Makefile.tt +15 -0
  19. data/lib/confluence/templates/README.markdown.tt +32 -0
  20. data/lib/confluence/templates/Rakefile.tt +36 -0
  21. data/lib/confluence/templates/Setup.hs.tt +1 -0
  22. data/lib/confluence/templates/TODO.markdown.tt +4 -0
  23. data/lib/confluence/templates/assets/html/_%project_name%.html.haml.tt +5 -0
  24. data/lib/confluence/templates/assets/images/README.markdown.tt +11 -0
  25. data/lib/confluence/templates/assets/javascripts/README.markdown.tt +1 -0
  26. data/lib/confluence/templates/assets/stylesheets/README.markdown.tt +1 -0
  27. data/lib/confluence/templates/lib/%project_name%.rb.tt +3 -0
  28. data/lib/confluence/templates/package.json.tt +15 -0
  29. data/lib/confluence/templates/spec/%project_name%_spec.rb.tt +7 -0
  30. data/lib/confluence/templates/spec/spec_helper.rb.tt +5 -0
  31. data/lib/confluence/templates/src/images/README.markdown.tt +11 -0
  32. data/lib/confluence/templates/src/javascripts/%project_name%.hs.tt +4 -0
  33. data/lib/confluence/templates/src/stylesheets/%project_name%.scss.tt +3 -0
  34. data/lib/confluence/templates/test/integration/.gitignore +15 -0
  35. data/lib/confluence/templates/test/integration/Gemfile +26 -0
  36. data/lib/confluence/templates/test/integration/Gemfile.lock +88 -0
  37. data/lib/confluence/templates/test/integration/README.rdoc +261 -0
  38. data/lib/confluence/templates/test/integration/Rakefile +7 -0
  39. data/lib/confluence/templates/test/integration/app/assets/images/rails.png +0 -0
  40. data/lib/confluence/templates/test/integration/app/assets/javascripts/application.js +13 -0
  41. data/lib/confluence/templates/test/integration/app/assets/javascripts/pages.js +2 -0
  42. data/lib/confluence/templates/test/integration/app/assets/stylesheets/application.css +13 -0
  43. data/lib/confluence/templates/test/integration/app/assets/stylesheets/pages.css +4 -0
  44. data/lib/confluence/templates/test/integration/app/controllers/application_controller.rb +3 -0
  45. data/lib/confluence/templates/test/integration/app/controllers/pages_controller.rb +35 -0
  46. data/lib/confluence/templates/test/integration/app/helpers/application_helper.rb +2 -0
  47. data/lib/confluence/templates/test/integration/app/helpers/pages_helper.rb +2 -0
  48. data/lib/confluence/templates/test/integration/app/mailers/.gitkeep +0 -0
  49. data/lib/confluence/templates/test/integration/app/models/.gitkeep +0 -0
  50. data/lib/confluence/templates/test/integration/app/views/layouts/application.html.erb +14 -0
  51. data/lib/confluence/templates/test/integration/app/views/pages/index.html.haml +1 -0
  52. data/lib/confluence/templates/test/integration/config.ru +4 -0
  53. data/lib/confluence/templates/test/integration/config/application.rb +63 -0
  54. data/lib/confluence/templates/test/integration/config/boot.rb +6 -0
  55. data/lib/confluence/templates/test/integration/config/environment.rb +5 -0
  56. data/lib/confluence/templates/test/integration/config/environments/development.rb +26 -0
  57. data/lib/confluence/templates/test/integration/config/environments/production.rb +51 -0
  58. data/lib/confluence/templates/test/integration/config/environments/test.rb +35 -0
  59. data/lib/confluence/templates/test/integration/config/initializers/backtrace_silencers.rb +7 -0
  60. data/lib/confluence/templates/test/integration/config/initializers/inflections.rb +15 -0
  61. data/lib/confluence/templates/test/integration/config/initializers/mime_types.rb +5 -0
  62. data/lib/confluence/templates/test/integration/config/initializers/secret_token.rb +7 -0
  63. data/lib/confluence/templates/test/integration/config/initializers/session_store.rb +8 -0
  64. data/lib/confluence/templates/test/integration/config/initializers/wrap_parameters.rb +10 -0
  65. data/lib/confluence/templates/test/integration/config/locales/en.yml +5 -0
  66. data/lib/confluence/templates/test/integration/config/routes.rb +60 -0
  67. data/lib/confluence/templates/test/integration/db/seeds.rb +7 -0
  68. data/lib/confluence/templates/test/integration/lib/assets/.gitkeep +0 -0
  69. data/lib/confluence/templates/test/integration/lib/tasks/.gitkeep +0 -0
  70. data/lib/confluence/templates/test/integration/public/404.html +26 -0
  71. data/lib/confluence/templates/test/integration/public/422.html +26 -0
  72. data/lib/confluence/templates/test/integration/public/500.html +25 -0
  73. data/lib/confluence/templates/test/integration/public/favicon.ico +0 -0
  74. data/lib/confluence/templates/test/integration/public/robots.txt +5 -0
  75. data/lib/confluence/templates/test/integration/script/rails +6 -0
  76. data/lib/confluence/templates/test/integration/vendor/assets/javascripts/.gitkeep +0 -0
  77. data/lib/confluence/templates/test/integration/vendor/assets/stylesheets/.gitkeep +0 -0
  78. data/lib/confluence/templates/test/integration/vendor/plugins/.gitkeep +0 -0
  79. data/lib/confluence/templates/test/javascripts/README.markdown.tt +1 -0
  80. data/spec/confluence/navigator_spec.rb +68 -0
  81. data/spec/confluence_spec.rb +31 -0
  82. data/spec/spec_helper.rb +15 -0
  83. data/spec/support/file_sytem/navigator.rb +9 -0
  84. metadata +249 -0
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile ADDED
@@ -0,0 +1,29 @@
1
+ source "http://rubygems.org"
2
+ source "http://gems.github.com"
3
+ # Add dependencies required to use your gem here.
4
+ # Example:
5
+ # gem "activesupport", ">= 2.3.5"
6
+ gem "rake"
7
+ gem "bundler"
8
+ gem "rdoc"
9
+ gem "simplecov"
10
+ gem "rspec"
11
+ gem "thor"
12
+
13
+ # Add dependencies to develop your gem here.
14
+ # Include everything needed to run rake, tests, features, etc.
15
+ group :development do
16
+ gem "jeweler", "~> 1.8.4"
17
+ end
18
+
19
+ group :debug do
20
+ gem (RUBY_VERSION =~ /^1\.9/ ? "ruby-debug19" : "ruby-debug")
21
+ end
22
+
23
+ group :xzibit do
24
+ # stole this page from jeweler's gemspec
25
+ # who apparently stole from bundler's gemspec
26
+ # adds confluence to this directory for the same reason
27
+ # that jeweler does it
28
+ # gem 'confluence', :path => '.'
29
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,56 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ remote: http://gems.github.com/
4
+ specs:
5
+ archive-tar-minitar (0.5.2)
6
+ columnize (0.3.6)
7
+ diff-lcs (1.1.3)
8
+ git (1.2.5)
9
+ jeweler (1.8.4)
10
+ bundler (~> 1.0)
11
+ git (>= 1.2.5)
12
+ rake
13
+ rdoc
14
+ json (1.7.6)
15
+ linecache19 (0.5.12)
16
+ ruby_core_source (>= 0.1.4)
17
+ multi_json (1.5.0)
18
+ rake (10.0.3)
19
+ rdoc (3.12.1)
20
+ json (~> 1.4)
21
+ rspec (2.12.0)
22
+ rspec-core (~> 2.12.0)
23
+ rspec-expectations (~> 2.12.0)
24
+ rspec-mocks (~> 2.12.0)
25
+ rspec-core (2.12.2)
26
+ rspec-expectations (2.12.1)
27
+ diff-lcs (~> 1.1.3)
28
+ rspec-mocks (2.12.2)
29
+ ruby-debug-base19 (0.11.25)
30
+ columnize (>= 0.3.1)
31
+ linecache19 (>= 0.5.11)
32
+ ruby_core_source (>= 0.1.4)
33
+ ruby-debug19 (0.11.6)
34
+ columnize (>= 0.3.1)
35
+ linecache19 (>= 0.5.11)
36
+ ruby-debug-base19 (>= 0.11.19)
37
+ ruby_core_source (0.1.5)
38
+ archive-tar-minitar (>= 0.5.2)
39
+ simplecov (0.7.1)
40
+ multi_json (~> 1.0)
41
+ simplecov-html (~> 0.7.1)
42
+ simplecov-html (0.7.1)
43
+ thor (0.17.0)
44
+
45
+ PLATFORMS
46
+ ruby
47
+
48
+ DEPENDENCIES
49
+ bundler
50
+ jeweler (~> 1.8.4)
51
+ rake
52
+ rdoc
53
+ rspec
54
+ ruby-debug19
55
+ simplecov
56
+ thor
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Thomas Chen
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = confluence
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to confluence
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
+ * Fork the project.
10
+ * Start a feature/bugfix branch.
11
+ * Commit and push until you are happy with your contribution.
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2013 Thomas Chen. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile ADDED
@@ -0,0 +1,45 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "confluence"
18
+ gem.homepage = "http://github.com/foxnewsnetwork/confluence"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{A sloppy blobulization of jeweler with things like integration testing, javascript compiling, etc. that seeks to provide a framework for writing modular web assets}
21
+ gem.description = %Q{confluence is the merging of rivers. In particular, it is the merging of the fay-haskell-coffee-js river with the scss-css river with the psd-png river into the rails-ruby-haml rivers}
22
+ gem.email = "foxnewsnetwork@gmail.com"
23
+ gem.authors = ["Thomas Chen"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rake/testtask'
29
+ Rake::TestTask.new(:test) do |test|
30
+ test.libs << 'lib' << 'test'
31
+ test.pattern = 'test/**/test_*.rb'
32
+ test.verbose = true
33
+ end
34
+
35
+ task :default => :test
36
+
37
+ require 'rdoc/task'
38
+ Rake::RDocTask.new do |rdoc|
39
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
40
+
41
+ rdoc.rdoc_dir = 'rdoc'
42
+ rdoc.title = "confluence #{version}"
43
+ rdoc.rdoc_files.include('README*')
44
+ rdoc.rdoc_files.include('lib/**/*.rb')
45
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.0
data/bin/confluence ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path("../lib/confluence", File.dirname(__FILE__))
4
+
5
+ Confluence::Application.start
data/lib/confluence.rb ADDED
@@ -0,0 +1,25 @@
1
+ require "rubygems"
2
+ require "thor"
3
+ Dir[File.join(File.dirname(__FILE__), "confluence", "*.rb")].each { |source| require source }
4
+
5
+ module Confluence
6
+ class Application < Thor
7
+ include Thor::Actions
8
+
9
+ attr_accessor :project_name, :project_author
10
+
11
+ desc "new", "Creates a new confluence assets project for you in your specified directory"
12
+ def new(project_name)
13
+ @project_name = project_name
14
+ @project_author = "Me"
15
+ source_path = File.join File.dirname(__FILE__), "confluence", "templates"
16
+ destination_path = project_name
17
+ directory( source_path, destination_path )
18
+ end
19
+
20
+ def self.source_root
21
+ File.join File.dirname(__FILE__), "confluence", "templates"
22
+ end
23
+
24
+ end
25
+ end
@@ -0,0 +1,67 @@
1
+ module Confluence
2
+ class Navigator
3
+ class Node
4
+ def self.from_filepath(filepath)
5
+ new filepath
6
+ end
7
+ attr_accessor :filepath
8
+
9
+ def initialize(filepath)
10
+ @filepath = filepath
11
+ end
12
+
13
+ def directory?
14
+ File.directory?(filepath)
15
+ end
16
+
17
+ def expand_path
18
+ entries = Dir.entries(filepath).select { |s| !(s == ".." || s == ".") }
19
+ nodes = entries.map { |entry| Node.from_filepath File.join(filepath, entry ) }
20
+ end
21
+ end
22
+
23
+ attr_accessor :start_path
24
+ attr_reader :callbacks
25
+
26
+ def initialize(start_path)
27
+ @start_path = start_path
28
+ @callbacks ||= {}
29
+ end
30
+
31
+ def on_encounter(type=:file, &block)
32
+ throw :NoBlockGivenError unless block_given?
33
+ throw :BadTypeError unless type == :directory || type == :file
34
+ (@callbacks[type] ||= []) << lambda(&block)
35
+ self
36
+ end
37
+
38
+ def run
39
+ _bfs_start(start_path)
40
+ end
41
+
42
+ private
43
+
44
+ # lol this is actually dfs. sorry
45
+ def _bfs_start(start_path)
46
+ # step 0: get a context
47
+ node_context = Node.from_filepath start_path
48
+
49
+ # step 1: expand node
50
+ nodes = node_context.expand_path
51
+
52
+ # step 2: filter nodes
53
+ node_hash = {}
54
+ node_hash[:directory] = nodes.select { |node| node.directory? } || []
55
+ node_hash[:file] = nodes.select { |node| !node.directory? } || []
56
+
57
+ # step 3: use the callback on all file nodes
58
+ callbacks.each do |key, cbs|
59
+ node_hash[key].each { |node| cbs.each {|cb| cb.call node.filepath } }
60
+ end
61
+
62
+ # step 4: recurse with the rest of the d_nodes
63
+ node_hash[:directory].each { |node| _bfs_start node.filepath }
64
+ end
65
+
66
+ end
67
+ end
@@ -0,0 +1,64 @@
1
+ -- Initial comment.cabal generated by cabal init. For further
2
+ -- documentation, see http://haskell.org/cabal/users-guide/
3
+
4
+ -- The name of the package.
5
+ name: <%= project_name %>
6
+
7
+ -- The package version. See the Haskell package versioning policy (PVP)
8
+ -- for standards guiding when and how versions should be incremented.
9
+ -- http://www.haskell.org/haskellwiki/Package_versioning_policy
10
+ -- PVP summary: +-+------- breaking API changes
11
+ -- | | +----- non-breaking API additions
12
+ -- | | | +--- code changes with no API change
13
+ version: 0.1.0.0
14
+
15
+ -- A short (one-line) description of the package.
16
+ synopsis: WRITE ME!
17
+
18
+ -- A longer description of the package.
19
+ -- description: WRITE ME
20
+
21
+ -- URL for the project homepage or repository.
22
+ homepage: WRITE ME
23
+
24
+ -- The license under which the package is released.
25
+ license: MIT
26
+
27
+ -- The file containing the license text.
28
+ license-file: LICENSE.txt
29
+
30
+ -- The package author(s).
31
+ author: WRITE ME
32
+
33
+ -- An email address to which users can send suggestions, bug reports, and
34
+ -- patches.
35
+ maintainer: WRITE ME
36
+
37
+ -- A copyright notice.
38
+ -- copyright:
39
+
40
+ category: Web
41
+
42
+ build-type: Simple
43
+
44
+ -- Constraint on the version of Cabal needed to build this package.
45
+ cabal-version: >=1.8
46
+
47
+
48
+ library
49
+ -- Modules exported by the library.
50
+ -- exposed-modules:
51
+
52
+ -- Modules included in this library but not exported.
53
+ -- other-modules:
54
+
55
+ -- Other library packages from which modules are imported.
56
+ build-depends:
57
+ base ==4.5.* ,
58
+ fay >=0.12.0.1
59
+
60
+
61
+
62
+ -- Directories containing source files.
63
+ hs-source-dirs: src/javascripts
64
+
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
@@ -0,0 +1,61 @@
1
+ # rcov / simple generated
2
+ coverage
3
+ coverage.data
4
+
5
+ # rdoc generated
6
+ rdoc
7
+
8
+ # yard generated
9
+ doc
10
+ .yardoc
11
+
12
+ # bundler
13
+ .bundle
14
+
15
+ # jeweler generated
16
+ pkg
17
+
18
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
19
+ #
20
+ # * Create a file at ~/.gitignore
21
+ # * Include files you want ignored
22
+ # * Run: git config --global core.excludesfile ~/.gitignore
23
+ #
24
+ # After doing this, these files will be ignored in all your git projects,
25
+ # saving you from having to 'pollute' every project you touch with them
26
+ #
27
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
28
+ #
29
+ # For MacOS:
30
+ #
31
+ #.DS_Store
32
+
33
+ # For TextMate
34
+ #*.tmproj
35
+ #tmtags
36
+
37
+ # For emacs:
38
+ #*~
39
+ #\#*
40
+ #.\#*
41
+
42
+ # For vim:
43
+ #*.swp
44
+
45
+ # For redcar:
46
+ #.redcar
47
+
48
+ # For rubinius:
49
+ #*.rbc
50
+
51
+ # For nodejs
52
+ node_modules
53
+
54
+ # for jamjs
55
+ jam
56
+
57
+ # for haskell
58
+ dist
59
+
60
+ # For integration testing logs
61
+ log
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,20 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "rails"
10
+ gem "thin"
11
+ gem "haml"
12
+ gem "rspec"
13
+ gem "sass"
14
+ gem "shoulda"
15
+ gem "rdoc"
16
+ gem "bundler"
17
+ gem "confluence"
18
+ gem "simplecov"
19
+ gem "jeweler"
20
+ end