Commit f330a27e authored by jaywink's avatar jaywink

Remove site and ruby tests

parent 8b6ebc2e
[submodule "site/source/docson"]
path = site/source/docson
url = https://github.com/lbovet/docson
language: ruby
sudo: false
gemfile: 'tests/Gemfile'
rvm:
- 2.1
script: "cd tests && bundle exec rake"
# Ignore bundler config
.bundle
# Ignore the build directory
build
# Ignore cache
.sass-cache
.cache
# Ignore .DS_store file
.DS_Store
source/index.md
source/protocol.md
source/ns/
source "https://rubygems.org"
gem "rake"
gem "middleman", "~> 3.4"
gem "middleman-deploy"
gem "middleman-livereload", "~> 3.4.0"
gem 'middleman-syntax'
gem "slim"
gem "compass"
gem "semantic-ui-sass"
gem "redcarpet"
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.3)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
capybara (2.4.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
chunky_png (1.3.4)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.9.1.1)
compass (1.0.3)
chunky_png (~> 1.2)
compass-core (~> 1.0.2)
compass-import-once (~> 1.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
sass (>= 3.3.13, < 3.5)
compass-core (1.0.3)
multi_json (~> 1.0)
sass (>= 3.3.0, < 3.5)
compass-import-once (1.0.5)
sass (>= 3.2, < 3.5)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
erubis (2.7.0)
eventmachine (1.0.8)
execjs (2.6.0)
ffi (1.9.10)
haml (4.0.7)
tilt
hike (1.2.3)
hooks (0.4.1)
uber (~> 0.0.14)
http_parser.rb (0.6.0)
i18n (0.7.0)
json (1.8.3)
kramdown (1.8.0)
listen (3.0.3)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
middleman (3.4.0)
coffee-script (~> 2.2)
compass (>= 1.0.0, < 2.0.0)
compass-import-once (= 1.0.5)
execjs (~> 2.0)
haml (>= 4.0.5)
kramdown (~> 1.2)
middleman-core (= 3.4.0)
middleman-sprockets (>= 3.1.2)
sass (>= 3.4.0, < 4.0)
uglifier (~> 2.5)
middleman-core (3.4.0)
activesupport (~> 4.1)
bundler (~> 1.1)
capybara (~> 2.4.4)
erubis
hooks (~> 0.3)
i18n (~> 0.7.0)
listen (~> 3.0.3)
padrino-helpers (~> 0.12.3)
rack (>= 1.4.5, < 2.0)
thor (>= 0.15.2, < 2.0)
tilt (~> 1.4.1, < 2.0)
middleman-deploy (1.0.0)
middleman-core (>= 3.2)
net-sftp
ptools
middleman-livereload (3.4.3)
em-websocket (~> 0.5.1)
middleman-core (>= 3.3)
rack-livereload (~> 0.3.15)
middleman-sprockets (3.4.2)
middleman-core (>= 3.3)
sprockets (~> 2.12.1)
sprockets-helpers (~> 1.1.0)
sprockets-sass (~> 1.3.0)
middleman-syntax (2.0.0)
middleman-core (~> 3.2)
rouge (~> 1.0)
mime-types (2.6.1)
mini_portile (0.6.2)
minitest (5.8.0)
multi_json (1.11.2)
net-sftp (2.1.2)
net-ssh (>= 2.6.5)
net-ssh (2.9.2)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
padrino-helpers (0.12.5)
i18n (~> 0.6, >= 0.6.7)
padrino-support (= 0.12.5)
tilt (~> 1.4.1)
padrino-support (0.12.5)
activesupport (>= 3.1)
ptools (1.3.2)
rack (1.6.4)
rack-livereload (0.3.16)
rack
rack-test (0.6.3)
rack (>= 1.0)
rake (10.4.2)
rb-fsevent (0.9.5)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
redcarpet (3.3.2)
rouge (1.9.1)
sass (3.4.17)
semantic-ui-sass (2.0.7.0)
sass (>= 3.2)
slim (3.0.6)
temple (~> 0.7.3)
tilt (>= 1.3.3, < 2.1)
sprockets (2.12.4)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-helpers (1.1.0)
sprockets (~> 2.0)
sprockets-sass (1.3.1)
sprockets (~> 2.0)
tilt (~> 1.1)
temple (0.7.6)
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uber (0.0.14)
uglifier (2.7.1)
execjs (>= 0.3.0)
json (>= 1.8.0)
xpath (2.0.0)
nokogiri (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
compass
middleman (~> 3.4)
middleman-deploy
middleman-livereload (~> 3.4.0)
middleman-syntax
rake
redcarpet
semantic-ui-sass
slim
BUNDLED WITH
1.10.6
require 'bundler/setup'
task "source/docson" do
sh "git submodule init"
sh "git submodule update"
end
directory "source/ns/schema"
rule(%r{^source/ns/schema/} => [proc{|source| "../schemas/#{source.split('/').last}/schema.json" }, "source/ns/schema"]) do |t|
cp t.source, t.name
end
task :install_schemas => %w(source/ns/schema/1.0)
file "source/protocol.md" => "../PROTOCOL.md" do |t|
cp t.source, t.name
end
file "source/index.md" => "../README.md" do |t|
source = File.read t.source
source.sub!("PROTOCOL.md", "protocol.html")
File.write t.name, source
end
task :prepare => %w(source/index.md source/protocol.md install_schemas source/docson)
desc "Build site locally"
task :build => :prepare do
sh "bundle exec middleman build"
end
desc "Start development server"
task :serve => :prepare do
sh "bundle exec middleman"
end
desc "Build and deploy site"
task :deploy => :build do
sh "bundle exec middleman deploy"
end
task :default => :build
###
# Compass
###
# Change Compass configuration
# compass_config do |config|
# config.output_style = :compact
# end
###
# Page options, layouts, aliases and proxies
###
# Per-page layout changes:
#
# With no layout
# page "/path/to/file.html", :layout => false
#
# With alternative layout
# page "/path/to/file.html", :layout => :otherlayout
#
# A path which all have the same layout
# with_layout :admin do
# page "/admin/*"
# end
# Proxy pages (http://middlemanapp.com/basics/dynamic-pages/)
# proxy "/this-page-has-no-template.html", "/template-file.html", :locals => {
# :which_fake_page => "Rendering a fake page with a local variable" }
###
# Helpers
###
# Automatic image dimensions on image_tag helper
# activate :automatic_image_sizes
# Reload the browser automatically whenever files change
# configure :development do
# activate :livereload
# end
# Methods defined in the helpers block are available in templates
# helpers do
# def some_helper
# "Helping"
# end
# end
helpers do
def active_class target
"active" if current_page.url == target
end
def nav_link_to content, target
link_to content, target, class: "item #{active_class(target)}"
end
end
activate :syntax
activate :livereload
set :css_dir, 'stylesheets'
set :js_dir, 'javascripts'
set :images_dir, 'images'
set :markdown_engine, :redcarpet
set :markdown, :fenced_code_blocks => true, :smartypants => true
# Build-specific configuration
configure :build do
# For example, change the Compass output style for deployment
activate :minify_css
# Minify Javascript on build
# activate :minify_javascript
# Enable cache buster
# activate :asset_hash
# Use relative URLs
# activate :relative_assets
# Or use a different image path
# set :http_prefix, "/Content/images/"
end
activate :deploy do |deploy|
deploy.method = :git
end
nodeinfo.diaspora.software
Subproject commit d0462ea770a76d2384a982dccf6653bcd94ce81b
doctype html
html
head
meta charset="utf-8" /
/ Always force latest IE rendering engine or request Chrome Frame
meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" /
/ Use title if it's in the page YAML frontmatter
title = current_page.data.title || "NodeInfo"
= stylesheet_link_tag "all"
= javascript_include_tag "all"
body class="#{page_classes}"
div id="nav" class="ui menu inverted large"
span class="item header" NodeInfo
= nav_link_to "Home", "/"
= nav_link_to "Protocol", "/protocol.html"
= nav_link_to "Schema", "/schema.html"
a id="forkme" href="https://github.com/jhass/nodeinfo"
img[src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67"
alt="Fork me on GitHub"
data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"] /
div id="main" class="ui segment basic"
= yield
h1 NodeInfo 1.0
script src="/docson/widget.js" data-schema="/ns/schema/1.0#" data-docson="/docson/index.html"
@import "semantic-ui";
@import "rouge";
body {
margin: 0;
}
#nav {
border-radius: 0;
}
#main {
width: 80%;
margin: 0 auto 5em;
}
.index {
h1 {
display: none;
}
}
#forkme {
img {
position: absolute;
top: 0;
right: 0;
border: 0;
}
}
<%= Rouge::Themes::Github.render(:scope => '.highlight') %>
--color
--require spec_helper
source "https://rubygems.org"
gem 'rake'
gem 'rspec'
gem 'json-schema-rspec'
GEM
remote: https://rubygems.org/
specs:
addressable (2.3.8)
diff-lcs (1.2.5)
json-schema (2.5.1)
addressable (~> 2.3.7)
json-schema-rspec (0.0.2)
json-schema (~> 2.5)
rspec
rake (10.4.2)
rspec (3.3.0)
rspec-core (~> 3.3.0)
rspec-expectations (~> 3.3.0)
rspec-mocks (~> 3.3.0)
rspec-core (3.3.2)
rspec-support (~> 3.3.0)
rspec-expectations (3.3.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.3.0)
rspec-mocks (3.3.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.3.0)
rspec-support (3.3.0)
PLATFORMS
ruby
DEPENDENCIES
json-schema-rspec
rake
rspec
BUNDLED WITH
1.10.6
require "bundler/setup"
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:rspec)
task default: :rspec
require 'spec_helper'
RSpec.describe "NodeInfo schema 1.0" do
it "is a valid draf4 json schema" do
expect(schema_for('1.0')).to match_json_schema :json_schema_draft4
end
it "validates the example" do
expect(example_for('1.0')).to match_json_schema :nodeinfo_10
end
end
require 'pathname'
require 'json-schema-rspec'
def base_path
Pathname.new(__dir__).join('../..').expand_path
end
def vendor_path
base_path.join 'vendor'
end
def schemas_path
base_path.join 'schemas'
end
def schema_path version
schemas_path.join version, 'schema.json'
end
def example_path version
schemas_path.join version, 'example.json'
end
def schema_for version
File.read schema_path(version)
end
def example_for version
File.read example_path(version)
end
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.filter_run :focus
config.run_all_when_everything_filtered = true
config.disable_monkey_patching!
if config.files_to_run.one?
config.default_formatter = 'doc'
end
config.profile_examples = 10
config.order = :random
Kernel.srand config.seed
config.include JSON::SchemaMatchers
config.json_schemas[:json_schema_draft4] = vendor_path.join('json-schema_draft4_core_validation.json').to_s
config.json_schemas[:nodeinfo_10] = schema_path('1.0').to_s
end
source "https://rubygems.org"
gem "json-schema"
GEM
remote: https://rubygems.org/
specs:
addressable (2.3.8)
json-schema (2.5.1)
addressable (~> 2.3.7)
PLATFORMS
ruby
DEPENDENCIES
json-schema
BUNDLED WITH
1.10.6
#!/usr/bin/env ruby
require "bundler/setup"
require "json"
require "json-schema"
schema = File.read File.expand_path "#{__dir__}/../schemas/1.0/schema.json"
json = JSON.parse(ARGF.read)
messages = JSON::Validator.fully_validate(schema, json)
if messages.empty?
puts "Everything valid!"
else
puts messages
end
{
"id": "http://json-schema.org/draft-04/schema#",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Core schema meta-schema",
"definitions": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#" }
},
"positiveInteger": {
"type": "integer",
"minimum": 0
},
"positiveIntegerDefault0": {
"allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
},
"simpleTypes": {
"enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
},
"stringArray": {
"type": "array",
"items": { "type": "string" },
"minItems": 1,
"uniqueItems": true
}
},
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uri"
},
"$schema": {
"type": "string",
"format": "uri"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"default": {},
"multipleOf": {
"type": "number",
"minimum": 0,
"exclusiveMinimum": true
},
"maximum": {
"type": "number"
},
"exclusiveMaximum": {
"type": "boolean",
"default": false
},
"minimum": {
"type": "number"
},
"exclusiveMinimum": {
"type": "boolean",
"default": false
},
"maxLength": { "$ref": "#/definitions/positiveInteger" },
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
"pattern": {
"type": "string",
"format": "regex"
},