From 5bd1ac806635763e317f359532ec4d1f9168fccc Mon Sep 17 00:00:00 2001 From: My Mai Date: Tue, 21 Apr 2015 22:45:08 +0700 Subject: [PATCH 1/6] Return Lotus.root path --- lib/lotus/root.rb | 7 +++++++ test/root_test.rb | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 lib/lotus/root.rb create mode 100644 test/root_test.rb diff --git a/lib/lotus/root.rb b/lib/lotus/root.rb new file mode 100644 index 000000000..4bcadd4ed --- /dev/null +++ b/lib/lotus/root.rb @@ -0,0 +1,7 @@ +require 'pathname' + +module Lotus + def self.root + Pathname.new(Dir.pwd) + end +end \ No newline at end of file diff --git a/test/root_test.rb b/test/root_test.rb new file mode 100644 index 000000000..c0fa09a4e --- /dev/null +++ b/test/root_test.rb @@ -0,0 +1,10 @@ +require 'test_helper' +require 'lotus/root' + +describe 'Lotus.root' do + let(:pathname) {Lotus.root} + it 'return root path' do + pwd = Pathname.getwd + pathname.must_equal pwd + end +end \ No newline at end of file From 32010cd52c4a30bf83495246cb1c2cd5adaaa49b Mon Sep 17 00:00:00 2001 From: My Mai Date: Tue, 21 Apr 2015 23:32:35 +0700 Subject: [PATCH 2/6] Add require 'lotus/root' --- lib/lotus.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/lotus.rb b/lib/lotus.rb index 2a0450b54..ded01cab4 100644 --- a/lib/lotus.rb +++ b/lib/lotus.rb @@ -2,6 +2,7 @@ require 'lotus/application' require 'lotus/container' require 'lotus/logger' +require 'lotus/root' # A complete web framework for Ruby # From f902f0f36ce996c6401c03743097ef34328bb48f Mon Sep 17 00:00:00 2001 From: My Mai Date: Sat, 25 Apr 2015 18:25:38 +0700 Subject: [PATCH 3/6] Change pathname root --- lib/lotus/root.rb | 2 +- test/root_test.rb | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/lotus/root.rb b/lib/lotus/root.rb index 4bcadd4ed..ac7243736 100644 --- a/lib/lotus/root.rb +++ b/lib/lotus/root.rb @@ -2,6 +2,6 @@ module Lotus def self.root - Pathname.new(Dir.pwd) + Lotus::Configuration.new.root end end \ No newline at end of file diff --git a/test/root_test.rb b/test/root_test.rb index c0fa09a4e..cf49d5c75 100644 --- a/test/root_test.rb +++ b/test/root_test.rb @@ -1,10 +1,12 @@ require 'test_helper' require 'lotus/root' -describe 'Lotus.root' do - let(:pathname) {Lotus.root} - it 'return root path' do - pwd = Pathname.getwd - pathname.must_equal pwd +describe 'Lotus' do + describe '.root' do + let(:pathname) { Lotus.root } + it 'returns root path' do + pwd = Pathname.getwd + pathname.must_equal pwd + end end end \ No newline at end of file From e995140024a5655d89cbc43e2582df2b94255f1a Mon Sep 17 00:00:00 2001 From: My Mai Date: Sun, 3 May 2015 12:45:04 +0700 Subject: [PATCH 4/6] Return lotus root --- lib/lotus/root.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lotus/root.rb b/lib/lotus/root.rb index ac7243736..4bcadd4ed 100644 --- a/lib/lotus/root.rb +++ b/lib/lotus/root.rb @@ -2,6 +2,6 @@ module Lotus def self.root - Lotus::Configuration.new.root + Pathname.new(Dir.pwd) end end \ No newline at end of file From fa3816b33d8d055ef558bc41259dd4db1bdb6483 Mon Sep 17 00:00:00 2001 From: My Mai Date: Sun, 3 May 2015 14:11:40 +0700 Subject: [PATCH 5/6] Get root via Lotus::Enviroment --- lib/lotus/root.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/lotus/root.rb b/lib/lotus/root.rb index 4bcadd4ed..bf6127fe7 100644 --- a/lib/lotus/root.rb +++ b/lib/lotus/root.rb @@ -1,7 +1,8 @@ require 'pathname' +require 'lotus/environment' module Lotus def self.root - Pathname.new(Dir.pwd) + Lotus::Environment.new.root end end \ No newline at end of file From 8e5d8af0cad3c46ebb09035da8a43be3eb4bb953 Mon Sep 17 00:00:00 2001 From: My Mai Date: Sun, 3 May 2015 15:00:01 +0700 Subject: [PATCH 6/6] Remove require pathname --- lib/lotus/root.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/lotus/root.rb b/lib/lotus/root.rb index bf6127fe7..949c7356e 100644 --- a/lib/lotus/root.rb +++ b/lib/lotus/root.rb @@ -1,4 +1,3 @@ -require 'pathname' require 'lotus/environment' module Lotus