Browse Source

Move README to src/main/asciidoc

pull/6/head
Dave Syer 10 years ago
parent
commit
563df2a975
  1. 42
      src/main/asciidoc/README.adoc
  2. 3
      src/main/asciidoc/intro.adoc
  3. 3
      src/main/asciidoc/spring-cloud-netflix.adoc
  4. 10
      src/main/ruby/generate_readme.sh
  5. 51
      src/main/ruby/readme.rb

42
README.md → src/main/asciidoc/README.adoc

@ -1,44 +1,6 @@ @@ -1,44 +1,6 @@
Ths project provides Netflix OSS integrations for Spring Boot apps through autoconfiguration
and binding to the Spring Environment and other Spring programming model idioms.
include::intro.adoc[]
# Eureka Clients
Example eureka client:
```
@Configuration
@ComponentScan
@EnableAutoConfiguration
@RestController
public class Application {
@RequestMapping("/")
public String home() {
return "Hello world";
}
public static void main(String[] args) {
new SpringApplicationBuilder(Application.class).web(true).run(args);
}
}
```
(i.e. utterly normal Spring Boot app). Configuration is required to locate the Eureka server. Example:
```
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8080/v2/
default.defaultZone: http://localhost:8080/v2/
```
The default application name, virtual host and non-secure port are taken from the `Environment` is
`${spring.application.name}`, `${spring.application.name}.mydomain.net` and `${server.port}` respectively.
# TODO List
== TODO List
- [x] Example front end app (currently in sandbox)
- [x] Example back end service (currently in sandbox)

3
src/main/asciidoc/intro.adoc

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
This project provides Netflix OSS integrations for Spring Boot apps through autoconfiguration
and binding to the Spring Environment and other Spring programming model idioms.

3
src/main/asciidoc/spring-cloud-netflix.adoc

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
= Spring Cloud Netflix
This project provides Netflix OSS integrations for Spring Boot apps through autoconfiguration
and binding to the Spring Environment and other Spring programming model idioms.
include::intro.adoc[]
== Service Discovery: Eureka Clients

10
src/main/ruby/generate_readme.sh

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
#!/usr/bin/env ruby
base_dir = File.join(File.dirname(__FILE__),'../../..')
src_dir = File.join(base_dir, "/src/main/asciidoc")
require File.join(File.dirname(__FILE__), 'readme.rb')
options = {}
ARGV.length > 0 and options[:to_file] = ARGV[0]
SpringCloud::Build.render_file("#{src_dir}/README.adoc", options)

51
src/main/ruby/readme.rb

@ -0,0 +1,51 @@ @@ -0,0 +1,51 @@
module SpringCloud
module Build
IncludeDirectiveRx = /^\\?include::([^\[]+)\[(.*?)\]$/
class << self
def process_include out, src, target, attrs
unless target.start_with?('/')
target = File.new(File.join(src, target))
else
target = File.new(target)
end
target.each do |line|
self.process(out, File.dirname(target), line)
end
end
def process out, src, line
if ((escaped = line.start_with?('\\include::')) || line.start_with?('include::')) && (match = IncludeDirectiveRx.match(line))
if escaped
out << line[1..-1]
else
self.process_include out, src, match[1], match[2].strip
end
else
out << line
end
end
def render_file file, options = {}
srcDir = File.dirname(file)
out = ["// Do not edit this file (go to #{file} instead)",""]
File.new(file).each do |line|
self.process(out, srcDir, line)
end
unless options[:to_file]
puts out
else
writer = File.new(options[:to_file],'w+')
out.each { |line| writer.write(line) }
end
end
end
end
end
Loading…
Cancel
Save